ASP.NET中$#=的用法

<%$     %>

 获取App_GlobalResources中message.resx文件中的B0011对应的字符串                                                        <asp:Button ID="btnExecute" runat="server" CssClass="pressedbutton" Font-Bold="True" Text="<%$ Resources:Message, B0011 %>" />

 获取App_LocalResource中***.aspx.resx文件中的ShoriYm对应的字符串                                                        <asp:Label ID="lblShoriYm" runat="server" CssClass="label_02" Text="<%$ Resources:ShoriYm%>" ></asp:Label></td>

获取web.config文件中的数据库连接字符串    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$connectionStrings:Pubs %>" SelectCommand="select * from catalog"></asp:SqlDataSource>

<%#     %>

数据绑定 

<asp:Label ID="lblId" runat="server" Text='<%#Eval("MenuBig_Id") %>' Visible="false"></asp:Label>       

<%=     %>

是在客户端获取服务器端的变量,后台往前台传值
<asp:Label ID="Label2" runat="server" CssClass="label"  Width="255px"><%=testStr%></asp:Label>

原文地址:https://www.cnblogs.com/angelfeather/p/1225922.html