Page.Culture Page.Culture Page.Culture Page.Culture Property


針對與頁面關聯的 Thread 物件,設定其文化特性 ID。Sets the culture ID for the Thread object associated with the page.

 property System::String ^ Culture { System::String ^ get(); void set(System::String ^ value); };
public string Culture { get; set; }
member this.Culture : string with get, set
Public Property Culture As String


有效的文化特性 ID。A valid culture ID.


在 .aspx 檔案的@ Page指示詞中設定屬性。CultureSet 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. 此外,您也可以用程式設計方式或在 web.config Culture檔案的全球化元素中明確設定屬性的值。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. 您可以將它設定為任何有效的文化特性識別碼。You can set it to any valid culture ID. 例如, en-us文化特性識別碼會將頁面設定為美式英文, fr而文化特性識別碼會將頁面設定為法文。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-us來限定自動語言偵測。The automatic language detection can be qualified with a default value such as auto:en-us.

如需詳細資訊,請CultureInfo參閱類別總覽。For more information, see the CultureInfo class overview.