Page.MetaDescription 屬性
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定 "description" meta
項目的內容。
public:
property System::String ^ MetaDescription { System::String ^ get(); void set(System::String ^ value); };
C#
[System.ComponentModel.Bindable(true)]
public string MetaDescription { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.MetaDescription : string with get, set
Public Property MetaDescription As String
"description" meta
項目的內容。
- 屬性
頁面沒有標頭控制項 (head
屬性設為「server」的 runat
項目)。
如果您將 MetaDescription 頁面的 屬性設定為 「ASP.NET Overview」,下列元素會出現在轉譯的 HTML 中:
<meta name="description" content="ASP.NET Overview" />
HTML meta
元素可用來改善搜尋引擎清單。 某些搜尋引擎會使用 「description」 meta
元素來改善清單預覽。
如果頁面標記的 元素中head
沒有 「description」 meta
元素,則會meta
在轉譯頁面時將元素新增至頁面。 如果頁面標記已經有 「description」 meta
元素,這個屬性會取得或設定 content
項目的屬性 meta
。
您也可以在 @ Page 指示詞中設定此屬性。
產品 | 版本 |
---|---|
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |