HOW TO MAKE RESPONSE.WRITE DISPLAY SPECIAL CHARACTER LIKE “<”,“>”

Jayden Bell

Total Post:110

Points:774
Posted by  Jayden Bell
C# 
 1299  View(s)
Ratings:
Rate this:

I want to use Response.Write to display some text on the screen using ASP.NET I created a variable

 

String s = "There is some <hidden text> which is not visible";

Response.Write(s);

What I found is when the browser only display "There is some which is not visible" any text written in between symbols '<'......'>' is neglected by the browser.

 

How can I display entire text?

Please advice.

  1. Kamlakar Singh

    Post:194

    Points:1396
    Re: How to make Response.Write Display special character like “<”,“>”

    Server.HtmlEncode("There is some <hidden text> which is not visible");

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!