赦免我的ASP无知,但有什么区别?
解决方法
这些有些非正式地称为“蜜蜂蜇”.有4种类型:
<%#%>在DataBinding阶段被调用.
<%=%>用于从代码到UI层获取值.倾向于与ASP应用程序向后兼容.不应该在.NET中使用.
<%@%>代表directives,允许行为设置而不诉诸代码.
<%:%> (在ASP.NET 4中引入)与%=相同,但是添加了HtmlEncoding功能的输出.意图是使它成为默认使用(超过%=)以帮助屏蔽脚本注入攻击.
Directives specify settings that are
used by the page and user-control
compilers when the compilers process
ASP.NET Web Forms pages (.aspx files)
and user control (.ascx) files.ASP.NET treats any directive block
(<%@ %>) that does not contain an
explicit directive name as an @ Page
directive (for a page) or as an @
Control directive (for a user
control).