How to display HTML code without rendering or converting?
Hi All,
I had saved a html code to database, and I want to display this code at UL without rendering, meaning needs to show all the HTML tags.
sample:
Hello in DB, and I want to see Hello at UL instead of bolded "Hello"
How can I attrive it? Literal & Label will auto render this HTML code to be bolded "Hello".
Thank you in advance for your time.

Kirtan PatelRank #292 · 8.6K reputationPosted Oct 7, 2009, 8:13 AM EDT
Here is Code for Displaying HTML in aspx page
dont forget to mark "Do you like this answer" please it will give me some credits :)
protected void Page_Load(object sender, EventArgs e)
{
//Your HTML Content
string HTML = "Hello World";
//Encode it to Convert it in < > etc
string Encoded = Context.Server.HtmlEncode(HTML);
//Show HTML Code in Aspx
Label1.Text = Encoded;
}
Master BillaRank #2,229 · 630 reputationPosted Oct 7, 2009, 8:04 AM EDT
its very easy
Add content place holder in your form, then read the string from the database and assign to content place holder
private void SetToGUI()
{
contntplachldr.controls.add(your html text);
}
thank you
Roei BarRank #1,271 · 1.4K reputationPosted Oct 7, 2009, 8:07 AM EDT
Ellen Hu55 reputationPosted Oct 7, 2009, 2:45 PM EDT