"App_LocalResources" vs. "App_GlobalResources" folder
Mainly there are two different types of resources, those available locally to the target element that has been localized (i.e. for the ASP.net Page or UserControl) and those that are globally available to the whole application.
Local resources are being generated by opening the design view of a Page or UserControl and by then clicking on the Visual Studio menu "Tools > Generate Local Resource". This automatically generates appropriate resource files in the "App_LocalResources" folder.
All of the generated resources within the App_LocalResources file are just locally available to each Page/UserControl they belong to.
On the other side, App_GlobalResources are - as the name already suggests - globally available to the whole application. They are normally not generated automatically, but created on demand. If the App_GlobalResources folder doesn't yet exist, it can be created by right-clicking on the project in the Visual Studio Solution Explorer and by then choosing the appropriate menu entry (as shown in the following figure)
Which resources are good candidates to become global?
Resources that are good candidates to become global and should therefore be placed in the App_GlobalResources folder are all those which may appear to be replicated throughout the application and are not specific to a certain Page or UserControl.
- Common action names such as "Save", "Delete", "Back",...
- Common, generic messages such as "Successfully saved", ...
Simply all of the resources that only belong to the Page or UserControl itself and are not shared among different entities.
How to access resources in the ASPX code?
Local resources can be accessed in the ASPX code either by specifying a meta:resourcekey tag (which is also automatically done by generating them through VS) or as follows:
<%= GetLocalResourceObject("resourcekey") %>
Global resources can be accessed by using the following syntax
<%$ Resources:GlobalResourceFilename, MY_KEY_IN_THE_RESOURCE_FILE %>
How to access resources in the C# code?