Solved

HTML tags are returned from the SQL Server database

Posted on 2012-04-03
2
180 Views
Last Modified: 2012-08-13
My users submit their text with a wysiwyg text editor. When I return the submitted values the HTML tags are also returned. How could I avoid this and see the formatted text instead?
Any help is appreciated.

<asp:BoundField HeaderText="Message" DataField="Message" ItemStyle-HorizontalAlign="Left" ></asp:BoundField>
0
Comment
Question by:baxtalo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 21

Accepted Solution

by:
masterpass earned 500 total points
ID: 37803607
I would say to use a contenttemplate and then bind to a label directly! This way the html will get rendered in the browser and you will be able to see the formatted text!

hope this helps!
0
 

Author Closing Comment

by:baxtalo
ID: 37804113
Yes, it helped. Thank you very much. This is what made it work:

<asp:TemplateField HeaderText="Message" ItemStyle-HorizontalAlign="Left" >
<ItemTemplate><%# Eval("Message") %>
</ItemTemplate>
</asp:TemplateField>
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question