Page.MetaKeywords Page.MetaKeywords Page.MetaKeywords Page.MetaKeywords Property

定義

取得或設定「關鍵字」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" />

備註

HTMLmeta項目可用來改善搜尋引擎的清單。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.

如果沒有任何 「 關鍵字 」meta中的項目head網頁標記中,項目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項目,這個屬性會取得或設定content屬性meta項目。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.

適用於

另請參閱