可能重复:
Are <%: and <%= the same thing as embbed code (expression) blocks
我正在使用.NET 4.0开发ASP.NET MVC 2应用程序。 只是想知道,
之间有什么区别 <%: item["Title"] %>
和
<%= item["Title"] %>
答案 0 :(得分:22)
第一个会自动HTML编码值。第二个不会。
<%: item["Title"] %>
相当于
<%= Html.Encode(item["Title"]) %>