Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ASP.NET Resources
01-13-2012, 07:56 PM
Post: #9
RE: ASP.NET Resources
Creating Resource Files for ASP.NET Web Sites


In ASP.NET, you can create resource files that have different scope. You can create resource files that are global, which means that you can read the resource file from any page or code that is in the Web site. You can also create local resource files, which store resources for a single ASP.NET Web page (.aspx file).
Global Resource Files

You create a global resource file by putting it in the reserved folder App_GlobalResources at the root of the application. Any .resx file that is in the App_GlobalResources folder has global scope. Additionally, ASP.NET generates a strongly typed object that gives you a simple way to programmatically access global resources.
Local Resource Files

A local resources file is one that applies to only one ASP.NET page or user control (an ASP.NET file that has a file-name extension of .aspx, .ascx, or .master). You put local resource files in folders that have the reserved name App_LocalResources. Unlike the root App_GlobalResources folder, App_LocalResources folders can be in any folder in the application. You associate a set of resources files with a specific Web page by using the name of the resource file.

For example, if you have a page named Default.aspx in the App_LocalResources folder, you might create the following files:

Default.aspx.resx. This is the default local resource file (the fallback resource file) if no language match is found.

Default.aspx.es.resx. This is the resource file for Spanish, without culture information.

Default.aspx.es-mx.resx. This is the resource file for Spanish (Mexico) specifically.

Default.aspx.fr.resx. This is the resource file for French, without culture information.

The base name of the file matches the page file name, followed by a language and culture name, and ending with the extension .resx. For a list of culture names, see CultureInfo.
Localizing Client Script Resources

Localization support for ASP.NET AJAX client script builds on the foundation of the ASP.NET 2.0 localization model. In this model, you embed script files and localized script resources in a hub-and-spoke organization of assemblies (satellite assemblies). You can then selectively use these embedded client scripts and resources for specific languages and regions. This model enables a single code base to support multiple cultures. There is also support for localized script files that are provided as .js files on disk. ASP.NET can serve localized client scripts and resources automatically for specific languages and regions.

For more information, see the following topics:

Localizing Resources for Component Libraries Overview

Walkthrough: Embedding Localized Resources for a JavaScript File

Walkthrough: Globalizing a Date by Using Client Script

cash for old carstow truck services perth|salvage cars perth
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
ASP.NET Resources - dreamcon - 06-05-2010, 04:48 PM
RE: ASP.NET Resources - barbaragabogrecan - 10-08-2010, 05:42 PM
RE: ASP.NET Resources - justinOrel - 02-04-2011, 04:01 PM
RE: ASP.NET Resources - peterpan020588 - 06-11-2011, 01:28 AM
RE: ASP.NET Resources - netshet - 08-15-2011, 07:21 PM
RE: ASP.NET Resources - anusha - 10-24-2011, 06:19 PM
RE: ASP.NET Resources - MarryRock - 11-30-2011, 09:33 PM
RE: ASP.NET Resources - displaybanner - 01-13-2012 07:56 PM
RE: ASP.NET Resources - hairtransplant - 01-18-2012, 08:06 PM
RE: ASP.NET Resources - sabizuk - 06-18-2013, 07:05 PM
RE: ASP.NET Resources - lovesamrats - 05-17-2016, 03:01 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)