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

定義

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

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

屬性值

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

備註

設定Culture屬性中@ Page .aspx 檔案中的指示詞。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 將頁面設定為美國英文,whilefr文化特性 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.

適用於

另請參閱