Page.Culture 属性

定义

设置与页关联的 Thread 对象的区域性 ID。Sets the culture ID for the Thread object associated with the page.

protected:
 property System::String ^ Culture {  void set(System::String ^ value); };
public:
 property System::String ^ Culture { System::String ^ get(); void set(System::String ^ value); };
protected string Culture { set; }
[System.ComponentModel.Browsable(false)]
public string Culture { get; set; }
member this.Culture : string
[<System.ComponentModel.Browsable(false)>]
member this.Culture : string with get, set
Protected Property Culture As String
Public Property Culture As String

属性值

String

一个有效的区域性 ID。A valid culture ID.

属性

注解

Culture .aspx 文件的 @ Page 指令中设置特性。Set the Culture attribute in the @ Page directive in the .aspx file. 请求页面时,动态生成的类将设置此属性的值。When the page is requested, the dynamically generated class sets the value of this property. 此外,还可以 Culture 通过编程方式或在 Web.config 文件的 全球化 元素中显式设置属性的值。In addition, you can also explicitly set the value of the Culture property programmatically or in the globalization element of the Web.config file.

Culture属性用于帮助本地化页面内容。The Culture property is used to help localize page content. 可以将其设置为任何有效的区域性 ID。You can set it to any valid culture ID. 例如, en-us 区域性 id 将页面设置为美国英语,而 fr 区域性 id 则将页面设置为法语。For example, the en-us culture ID sets the page to American English, while the fr culture ID sets the page to French. 你还可以设置一个值,该值 auto 将自动检测浏览器的首选语言并对其进行设置。You can also set the value to auto which will perform automatic detection of the browser's preferred language and set it. 可以使用默认值(例如)来限定自动语言检测 auto:en-usThe automatic language detection can be qualified with a default value such as auto:en-us.

有关详细信息,请参阅 CultureInfo 类概述。For more information, see the CultureInfo class overview.

适用于

另请参阅