Friday, 24 February 2012

.Net Beginners : How to write HTML text or Encoded text on the web page?

There are many cases when we need to display HTML text as HTML text without applying HTML formatting.

Syntax :

Example :
   lblProductName.Text = Server.HtmlEncode("<h1>Hi</h1>")

Output :

Without out using of HtmlEncode method It will display Formatted HTML text.
 Example :
   lblProductName.Text = "<h1>Hi</h1>"

Output :

No comments:

Post a Comment