各种符号的asp.net的.aspx页面中含义 [英] Meaning of the various symbols in .aspx page of asp.net

查看:110
本文介绍了各种符号的asp.net的.aspx页面中含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have come across different symbols in .aspx page of asp.net

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

有这些符号背后的基本逻辑还是仅仅是我们必须记住盲目语法? &是什么LT;%%>一般意味着

Is there any underlying logic behind these symbols or is it just syntax which we have to remember blindly? What does <% %> mean in general ?

请帮我。

谢谢期待

推荐答案

这仅仅是语法。

&LT;%%GT; 简直就是简称&LT;脚本=服务器&GT; &LT; / SCRIPT&GT; code呈现块的。

<% %> is simply short for <script runat="server"> </script> aka code render blocks.

&LT;%#%&GT; 结合前pressions (加上以上)。

&LT;%=%&GT; 是上面+ A 的Response.Write()

&LT;%:%&GT; 是上面+ A 的Response.Write()包装在 Html.En code (新在.NET 4.0中)。

<%: %> is the above + a Response.Write() wrapped in Html.Encode (new in .NET 4.0).

&LT;%$%&GT; 是的 ASP.NET前pression ,用来在运行时绑定的配置或资源文件中的数据。

<%$ %> is an ASP.NET expression, used to bind configuration or resource file data during runtime.

这篇关于各种符号的asp.net的.aspx页面中含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆