Solved

HTML tags are returned from the SQL Server database

Posted on 2012-04-03
2
177 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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