Skip to main content
 首页 » 编程设计

"" rel="bookmark">c#之如何使 Response.Write 显示特殊字符,如 "",">"

2024年02月13日11birdshome

我想使用 Response.Write 在使用 ASP.NET 的屏幕上显示一些文本 我创建了一个变量

String s = "There is some <hidden text> which is not visible"; 
Response.Write(s); 

我发现当浏览器只显示“有一些不可见”时 浏览器会忽略符号 '<'......'>' 之间的任何文本。

如何显示整个文本?

请指教。

请您参考如下方法:

你可以试试这个:

String s = @"There is some <hidden text> which is not visible"; 
Response.Write(s);