ASP.NET&其中;%=%GT; VS&所述;%:%GT; [英] ASP.NET <%= %> vs <%: %>
问题描述
看来我失去了一些东西。但自从.NET 4.0中走了出来我已经看到参考&LT;%:%&GT;
语法ASP.NET。现在看来似乎是类似于&LT;%=%&GT;
但显然是有原因的新语法。我试图谷歌,但搜索&LT;%:%&GT;
似乎并不返回任何东西。什么是&LT;%:%&GT;
语法呢?当时它的.Net 4.0或3.5引入了?有人可以告诉我吗?
It seems I am missing something. But ever since .Net 4.0 came out I have been seeing reference to <%: %>
syntax for ASP.NET. It seems like it is similar to <%= %>
but clearly there is a reason for the new syntax. I tried google but searching <%: %>
doesn't seem to return anything. What does the <%: %>
syntax do? Was it introduced in .Net 4.0 or 3.5? Can someone enlighten me?
编辑:请提供参考或例子
推荐答案
我相信在&lt;%:%>是自动HtmlEncoding
i believe the <%: %> is auto HtmlEncoding
这篇文章从斯科特谷将有助于解释 - 它是在.NET 4.0和MVC2介绍
this post from Scott Gu will help to explain - it was introduced in .net 4 and MVC2
<一个href="http://weblogs.asp.net/scottgu/archive/2010/04/06/new-lt-gt-syntax-for-html-encoding-output-in-asp-net-4-and-asp-net-mvc-2.aspx">http://weblogs.asp.net/scottgu/archive/2010/04/06/new-lt-gt-syntax-for-html-encoding-output-in-asp-net-4-and-asp-net-mvc-2.aspx
这篇关于ASP.NET&其中;%=%GT; VS&所述;%:%GT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!