Page.MetaDescription Page.MetaDescription Page.MetaDescription Page.MetaDescription Property

定義

取得或設定 "description" meta 項目的內容。Gets or sets the content of the "description" meta element.

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

屬性值

"description" meta 項目的內容。The content of the "description" meta element.

例外狀況

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

範例

如果您將設定MetaDescription屬性 [ASP.NET 概觀] 頁面的下列項目會出現在轉譯的 HTML:If you set the MetaDescription property of a page to "ASP.NET Overview", the following element will appear in the rendered HTML:

<meta name="description" content="ASP.NET Overview" />

備註

HTMLmeta項目可用來改善搜尋引擎的清單。HTML meta elements can be used to improve search-engine listings. "description"meta項目可由部分搜尋引擎結果來改善清單預覽。The "description" meta element is used by some search engines to improve listing previews.

如果沒有任何 「 描述 」meta中的項目head網頁標記中,項目meta項目加入至頁面呈現頁面時。If there is no "description" 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 "description" 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.

適用於

另請參閱