Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这些在 ASP.NET 中叫什么?
<%# ... %>
<%= ... %>
<%: ... %>
有哪些不同的变化?它们每个是如何使用的?
像这样的标签的通用术语<% %>是“掘金”,除此之外<%@ %>称为指令。
<% %>
<%@ %>
可以在.NET“代码块”中找到每个块的使用方式?.
那是一个代码块。带有 的版本#用于数据绑定。它们基本上允许您将 C# 代码嵌入到您的 aspx 页面中。
#
MSDN 这里有一篇关于代码块的好文章,这里有一篇关于数据绑定表达式的好文章。