Page.MetaDescription 属性

定义

获取或设置“描述”meta 元素的内容。

public:
 property System::String ^ MetaDescription { System::String ^ get(); void set(System::String ^ value); };
[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

属性值

String

“描述”meta 元素的内容。

属性

例外

页面没有标题控件(head 特性设置为“server”的 runat 元素)

示例

如果将页面的属性设置为 MetaDescription “ASP.NET 概述”,则呈现的 HTML 中将显示以下元素:

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

注解

HTML meta 元素可用于改进搜索引擎列表。 某些搜索引擎使用“description” meta 元素来改进列表预览。

如果页面标记的元素中head没有“description”meta元素,则呈现页面时,该meta元素将添加到页面。 如果页面标记已有“description” meta 元素,则此属性获取或设置 content 元素的属性 meta

还可以在 @ Page 指令中设置此属性。

适用于

另请参阅