我想使用 Response.Write 使用 ASP.NET 在屏幕上显示一些文本我创建了一个变量
String s = "There is some <hidden text> which is not visible";
Response.Write(s);
我发现当浏览器只显示“有一些不可见”时,任何写在符号 '<'......'>' 之间的文本都会被浏览器忽略。
如何显示整个文本?
请指教。
我想使用 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);
使用HTML 编码
Server.HtmlEncode("There is some <hidden text> which is not visible");
我不熟悉 C#,所以这可能行不通,但是您可以使用 html 转义字符来转义<
and 。>
<
为了<
>
为了>
所以也许试试...
String s = "There is some <hidden text> which is not visible";