我找不到该信息的任何地方。大概是因为谷歌被忽略的关键字。是否有使用之间的差异<%:
和<%=
在你的aspx页面?他们似乎可以互换的。
I can't find this info anywhere. Probably because Google is ignoring the keywords. Is there a difference between using <%:
and <%=
in your aspx page? They seem interchangeable.
&LT;%:%&GT;
是在ASP.NET MVC 2 一个新事物。这是一样的&LT;%= Html.En code(文本)%&GT;
。建议始终使用&LT;%:%&GT;
除非你有特殊理由不这样做(例如,您是从一些文件或数据库中呈现的数据是已经连接codeD)。
<%: %>
is a new thing in ASP.NET MVC 2. It is the same as <%= Html.Encode("Text") %>
. It is recommended to always use <%: %>
unless you have some specific reason to not do so (for example, you are rendering data from some file or database that's already been encoded).