Page.Culture 属性

定义

设置与页关联的 Thread 对象的区域性 ID。

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。

属性

注解

Culture .aspx 文件中的 @ Page 指令中设置属性。 请求页面时,动态生成的类将设置此属性的值。 此外,还可以以编程方式或在Web.config文件的全球化元素中显式设置属性的值Culture

Culture 属性用于帮助本地化页面内容。 可以将它设置为任何有效的区域性 ID。 例如,区域性 ID 将 en-us 页面设置为美国英语,而区域性 ID 将 fr 页面设置为法语。 还可以设置 auto 值,该值将执行浏览器的首选语言的自动检测并对其进行设置。 可以使用默认值(例如 auto:en-us)限定自动语言检测。

有关详细信息,请参阅 CultureInfo 类概述。

适用于

另请参阅