views:

23

answers:

1

How to use them in a ASP.NET Web Application project? Any difference?

many thanks

A: 

Local Resources:

  1. Local resource is specific to a single Web page and used for providing versions of a Web page in different languages.
  2. Local resources must be stored in App_LocalResources sub folder.
  3. Local resources must be named in format [.language / language and culture].resx.

Ex: Default.aspx.resx- Base resource file. This is the default, or fallback, resource file.

Default.aspx.de.resx- A resource file for German etc.

Global Resources:

Global Resources Localization Suggestion for ASP.NET

  1. Global resource can be read from any page or code that is in the application.
  2. Global resource must be stored in App_GlobalResources at the root of the application.

    // Get the global resource string.

     try
     { 
         globalresourcestring = (String)GetGlobalResourceObject("MyResource", "GlobalResourceString1"); 
     } 
     catch
     { 
         globalresourcestring = "Could not find global resource."; 
     }
    
Pranay Rana
how call global resource from c#?
afsharm
check the updated answer
Pranay Rana
tnks parany, I have also used by this way too: `Resources.GeneralMessages.msg` where `msg` is the name of that resource.
afsharm