asp.net MVC Html.Encode(item.Title) 解释

定义和用法
HTMLEncode 方法对一段指定的字符串应用 HTML 编码。
语法
Server.HTMLEncode(
string)参数 描述
string 必需。要编码的字符串。
实例
脚本:

<%
response.write(Server.HTMLEncode(
"The image tag: <img>"))
%>

输出:
Theimage tag:
&lt;img&gt;

浏览器的输出:
The image tag:
<img>

你可能感兴趣的:(mvc,职场,asp.net,解释,休闲,Html.Encode(""))