Solved

HTML tags are returned from the SQL Server database

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now