| |||||
Page.Culture PropertySystem.Web.UI Namespace Page Class Gets or sets the culture name for the Thread object associated with the page. [ VB ] Public Property Culture As String [ C# ] public string Culture { get; set; } [ C++ ] public: property String^ Culture { String^ get ( ); void set ( String^ value ); } [ JScript ] public function get Culture ( ) : String public function set Culture ( value : String ) Property ValueA valid culture name. RemarksThe Culture property is used to help localize page content. The Culture value determines the results of culture-dependent functions, such as the date, number, and currency formatting.
The property can be set to any valid culture name. For example, the en-US culture name sets the page to American English, while the fr-FR culture name sets the page to French. The value can also be set to auto which performs automatic detection of the browser's preferred language. The automatic language detection can be qualified with a default value such as auto:en-US. The Culture attribute can be set in the @ Page directive in the <%@ Page Language="C#" Culture="auto" UICulture="auto" %> In addition, the value of the Culture property can also be set programmatically string selectedLanguage = Request.Form [ "lstLanguages" ]; Culture = selectedLanguage; UICulture = selectedLanguage; or in the globalization element of the <configuration>
<system.web>
<globalization
requestEncoding = "us-ascii"
responseEncoding = "iso-8859-1"
culture = "fr-FR"
uiculture = "fr" />
</system.web>
</configuration>
ExampleThe following example illustrates how to programmatically set the Culture property to localize page content. See AlsoPage Members Page.UICulture Property Page.LCID Property |
| ||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme