Learning without thinking is reckless, thinking without learning is dangerous, one small step per day, a big step in success
App_GlobalResources and App_LocalResources are used in ASP.
App_GlobalResources is a global resource folder that contains information that is needed for all pages. App_LocalResources is a local resource folder, which is primarily a string and information to be used for this page.
First, let's take a look at how to create and use global and local resources in VS, first open VS, create a new Web page item, then click the Web site project, then right-click, new Folder App_GlobalResources and App_LocalResources
Then in App_GlobalResources, right-click Add New Item,Default.aspx. resx
And then how do you use that resource? Watch the code in text
<form id="Form1"runat="Server"> <div> <%--<asp:label id="Label1"runat="Server"text="<%$ resources:age%>"></asp:Label>--%> <asp:literal id="Literal1"runat="Server"text="<%$ resources:default.aspx,name%>"/> <asp:literal id="Literal2"runat="Server"text="<%$ resources:default.aspx,age%>"/> </div> </form>
Creating a local resource is the same as creating a global resource, but creating a local resource is named with the page name of the page, such as Index.aspx, and the new resource in the local resource is index.aspx.resx.
How do I use local resources? There are two ways to use local resources. Look at the following code
<form id="Form1"runat="Server"> <div> <asp:literal id="Literal1"text="<%$ resources:titile%>"runat="Server"></asp:Literal> <asp:button id="btnsubmit"meta:resourcekey="btnsubmit"runat="Server"/> </div> </form>
The code is downloaded as follows