ASP如何输出HTML源码

来源:百度知道 编辑:UC知道 时间:2024/06/09 01:02:41
比如 b="<font color=red>qq</font>"
如果直接RESPONSE的话只会输出红色的“qq”
要整样才能输出"<font color=red>qq</font>"呢

(不能是response.write "<font color=red>qq</font>"啊
只能用b来输出)

最简单的方式使用 Server.Htmlencode

b="<font color=red>qq</font>"
Response.write Server.Htmlencode(b)

b="<font color=red>qq</font>"
Response.write Server.Htmlencode(b)

b = "<xmp><font color=red>qq</font></xmp>"
response.write b

<%
b="<font color=red>qq</font>"
b=replace(b,"<","&lt;")
response.write b
%>

response.write ""<font color=red>qq</font>""