标签:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<%--把文本原样输出--%>
<%=Server.HtmlEncode("<span style=‘color:rebeccapurple;‘>测试</span>") %>
<%-- HTML正常输出--%>
<%=Server.HtmlDecode("<span style=‘color:rebeccapurple;‘>测试2</span>") %>
</div>
</form>
</body>
</html>
asp.net Server.HtmlEncode和HtmlDecode
标签:
原文地址:http://www.cnblogs.com/chao2014/p/4951520.html