.NET Samples - ASP.NET Localization

This section includes the following samples:

news-de Sample

news-en-us Sample

news-ja Sample

News Sample

CultureInfo Sample

Regional Sample

news-de Sample

news-ja Sample

news-en-us Sample

Using Localized Controls Sample

Encoding Sample

news-de Sample

This sample demonstrates a simple method for localizing ASP.NET pages, by translating content and setting the current culture.

Namespaces used in this sample:

System; System.Threading; System.Globalization

Classes used in this sample:

String; Import; Page; Type; Thread

news-en-us Sample

This sample demonstrates a simple method for localizing ASP.NET pages, by translating content and setting the current culture.

Namespaces used in this sample:

System; System.Threading; System.Globalization

Classes used in this sample:

Thread; String; Import; Page; Type

news-ja Sample

This sample demonstrates a simple method for localizing ASP.NET pages, by translating content and setting the current culture.

Namespaces used in this sample:

System; System.Threading; System.Globalization

Classes used in this sample:

String; Import; Page; Type; Thread

News Sample

This sample demonstrates using an external resource file to separate localizable strings from application code.

Namespaces used in this sample:

System; System.Globalization; System.Threading; System.Resources

Classes used in this sample:

String; Thread; Button; Page; CultureInfo; Import; AdRotator; ResourceManager; EventArgs; Image; Object; Application; HtmlTextWriter; Panel; TextWriter; DropDownList; Type; Exception; TextBox; Url; File; Cache

CultureInfo Sample

This sample demonstrates how to set and retrieve the current culture for an ASP.NET page. The current culture affects the way culture-sensitive information, such as date and time, is formatted.

Namespaces used in this sample:

System; System.Threading; System.Globalization

Classes used in this sample:

CultureInfo; Thread; String; Page; Import; Encoding; Exception; ArgumentException; Object; EventArgs

Regional Sample

This sample demonstrates how to set and retrieve the region for an ASP.NET page. The region affects the way region-sensitive information, such as currency, is formatted.

Namespaces used in this sample:

System; System.Threading; System.Globalization

Classes used in this sample:

Region; RegionInfo; Page; String; Import; Object; Type; Encoding; Thread; Exception; ArgumentException; EventArgs

news-de Sample

This sample demonstrates a simple method for localizing ASP.NET pages, by translating content and setting the current culture. It differs from the sample above in that it encapsulates localized content into ASP.NET server controls that output an appropriate user interface based on the culture setting.

Namespaces used in this sample:

System; System.Globalization; System.Threading

Classes used in this sample:

Button; Import; Page; CultureInfo; Image; String; HtmlTextWriter; Panel; TextWriter; Url; Type; EventArgs; Thread; TextBox; Object

news-ja Sample

This sample demonstrates a simple method for localizing ASP.NET pages, by translating content and setting the current culture. It differs from the sample above in that it encapsulates localized content into ASP.NET server controls that output an appropriate user interface based on the culture setting.

Namespaces used in this sample:

System; System.Globalization; System.Threading

Classes used in this sample:

Button; Import; Page; CultureInfo; Image; String; HtmlTextWriter; Panel; TextWriter; Url; Type; EventArgs; Thread; TextBox; Object

news-en-us Sample

This sample demonstrates a simple method for localizing ASP.NET pages, by translating content and setting the current culture. It differs from the sample above in that it encapsulates localized content into ASP.NET server controls that output an appropriate user interface based on the culture setting.

Namespaces used in this sample:

System; System.Globalization; System.Threading

Classes used in this sample:

Button; Import; Page; CultureInfo; Image; String; HtmlTextWriter; Panel; TextWriter; Url; Type; EventArgs; Thread; TextBox; Object

Using Localized Controls Sample

This sample demonstrates using satellite assemblies to deploy version-independent resources for localization.

Namespaces used in this sample:

System; System.Threading; System.Globalization; System.Resources

Classes used in this sample:

Button; CultureInfo; Thread; Control; Import; Page; Assembly; Type

Encoding Sample

This sample demonstrates using different encoding types on the same page. The source for the page itself is stored with UTF-8 encoding. Internally, ASP.NET handles the page as Unicode. By using the ResponseEncoding attribute, ASP.NET is asked to send the page with UTF-8 encoding.

Namespaces used in this sample:

(none)

Classes used in this sample:

Encoding; Page