What does the <% $Resources:My.Resource %> access?
I tried searching, but 开发者_运维百科I guess the <% $ %> triggers something on google and it turns up nothing. What is this accessing in an asp.net .aspx page? I've used the = but never a $.
It has to do with expressions. Here's another example :
<asp:SqlDataSource ID="SqlDataSource1" Runat="server"
SelectCommand="SELECT * FROM [Employees]"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString1 %>" />
Here ya go : http://msdn.microsoft.com/en-us/library/d5bd1tad.aspx
I've not used Resources before but, here is some more information from MSDN : http://msdn.microsoft.com/en-us/library/aa905797.aspx
It uses the global resource file under the App_GlobalResources directory. This syntax is used when you want to assign the string directly to property of a asp.net server control. For ex:
<asp:Label id="label1" runat="server" text="<%$ Resources: ResourceFileName, Label1String %>" />
Also see the link provided in rib.usa's answer which has more information.
精彩评论