asp.net - asp.net .aspx页面中各种符号的含义

标签 asp.net symbols

我在 asp.net 的 .aspx 页面中遇到了不同的符号

<%#eval(expr) %> 
<%#bind(expr) %>
<% %>  - for specifying the c# code in aspx page
<%$ %> - for specifying the SQL connection string in <asp:SqlDataSource>

这些符号背后是否有任何潜在的逻辑,或者只是我们必须盲目记住的语法? <% %> 一般意味着什么?

最佳答案

这只是语法。

<% %><script runat="server"> </script> 的缩写又名 code render blocks .

<%# %>binding expressions (加上上面的内容)。

<%= %>就是上面的 + a Response.Write() .

<%: %>就是上面的 + a Response.Write()包裹在 Html.Encode (.NET 4.0 中的新增功能)。

<%$ %>ASP.NET expression ,用于在运行时绑定(bind)配置或资源文件数据。

关于asp.net - asp.net .aspx页面中各种符号的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5833278/

相关文章:

asp.net - bundle 中的文件排序 - 已知的库有哪些?

c# - ASP.NET MVC4 显示所有注册用户名

matlab - 禁用 Matlab 符号有理逼近

javascript - 新的 JavaScript "Symbol"数据类型有哪些可能的使用场景?

python - matplotlib:将特殊数学符号添加到 xticklabels

shared-libraries - 从共享对象 Windows/MinGW 中访问应用程序内部的符号

asp.net - IIS AppPoolIdentity 和文件系统写入访问权限

asp.net - 静态文件的 IIS 500.0 AuthenticateRequest 错误

ASP.NET 站点通过 SSL 从 Visual Studio 而不是 IIS 连接到远程

ruby - 在 Ruby 散列中使用 fixnums 作为键好吗?