Asp.net server-side code block explanations

半城伤御伤魂 提交于 2019-12-17 18:09:07

问题


I've seen many different types of server side code blocks in aspx but never a simple key for what each means. I know some of these but it's really hard to search for symbols in a search engine! Can you help me out?

<% %> 
<%-- --%> 
<%@ %>
<%= %>
<%: %>
<%$ %>
<%# %>

回答1:


  • <% %> - Server side code
  • <%-- --%> - Server Side Comment
  • <%@ %> - Page Directive
  • <%= %> - Display value
  • <%: %> - HTML Encode
  • <%$ %> - Datasource Expression
  • <%# %> - Binding Expression

You can find a bit more information about some of them at "ASP.NET Page Syntax".



来源:https://stackoverflow.com/questions/6365017/asp-net-server-side-code-block-explanations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!