.NET Framework Class Library
Page..::.MetaDescription Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets or sets the content of the "description" meta element.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)
Syntax

Visual Basic (Declaration)
<BindableAttribute(True)> _
Public Property MetaDescription As String
    Get
    Set
Visual Basic (Usage)
Dim instance As Page
Dim value As String

value = instance.MetaDescription

instance.MetaDescription = value
C#
[BindableAttribute(true)]
public string MetaDescription { get; set; }
Visual C++
[BindableAttribute(true)]
public:
property String^ MetaDescription {
    String^ get ();
    void set (String^ value);
}
F#
[<BindableAttribute(true)>]
member MetaDescription : string with get, set
ASP.NET
<asp:Page MetaDescription="String" />

Property Value

Type: System..::.String
The content of the "description" meta element.
Exceptions

ExceptionCondition
InvalidOperationException

The page does not have a header control (a head element with the runat attribute set to "server").

Remarks

HTML meta elements can be used to improve search-engine listings. The "description" meta element is used by some search engines to improve listing previews.

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. If the page markup already has a "description" meta element, this property gets or sets the content attribute of the meta element.

You can also set this property in the @ Page directive.

Examples

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" />

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 4
See Also

Reference

Page view tracker