Page.MetaKeywords 屬性

定義

取得或設定「關鍵字」meta 項目的內容。

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

屬性值

「關鍵字」meta 項目的內容。

屬性

例外狀況

頁面沒有標頭控制項 (head 屬性設為「server」的 runat 項目)。

範例

如果您將 MetaKeywords 頁面的 屬性設定為 「HTML,CSS,XML,JavaScript」,下列元素會出現在轉譯的 HTML 中:

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

備註

HTML meta 元素可用來改善搜尋引擎清單。 「keywords」 meta 元素完全未使用,或由主要搜尋引擎提供非常小的權數。

如果頁面標記的 元素中 head 沒有 「keywords」 meta 元素,則會 meta 在轉譯頁面時將元素加入頁面。 如果頁面標記已經有 「keywords」 meta 元素,這個屬性會取得或設定 content 專案的 meta 屬性。

您也可以在 @ Page 指示詞中設定此屬性。

適用於

另請參閱