Page.MetaKeywords 屬性

定義

取得或設定「關鍵字」meta 項目的內容。Gets or sets the content of the "keywords" meta element.

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

屬性值

「關鍵字」meta 項目的內容。The content of the "keywords" meta element.

屬性

例外狀況

頁面沒有標頭控制項 (head 屬性設為「server」的 runat 項目)。The page does not have a header control (a head element with the runat attribute set to "server").

範例

如果您將頁面的 [MetaKeywords] 屬性設為 [HTML,CSS,XML,JavaScript],下列專案將會出現在轉譯的 HTML 中:If you set the MetaKeywords property of a page to "HTML,CSS,XML,JavaScript", the following element will appear in the rendered HTML:

<meta name="keywords" content=" HTML,CSS,XML,JavaScript" />

備註

HTML meta 元素可以用來改善搜尋引擎清單。HTML meta elements can be used to improve search-engine listings. 「關鍵字」 meta 元素完全不會使用,或由主要搜尋引擎提供極小的權數。The "keywords" meta element is either not used at all or is given very little weight by the major search engines.

如果頁面標記的 head 元素中沒有 "關鍵字" meta 專案,則在呈現頁面時,會將 meta 元素加入至頁面。If there is no "keywords" meta element in the head element of the page markup, the meta element is added to the page when the page is rendered. 如果頁面標記已經有「關鍵字」 meta 專案,這個屬性會取得或設定 meta 元素的 content 屬性。If the page markup already has a "keywords" meta element, this property gets or sets the content attribute of the meta element.

您也可以在@ Page指示詞中設定這個屬性。You can also set this property in the @ Page directive.

適用於

另請參閱