Partager via


HtmlMeta Server Control Declarative Syntax 

Creates a server-side control that maps to the meta HTML element and allows you to create a container for data about the rendered page, but not page content itself.

<meta
    EnableViewState="False|True"
    ID="string"
    Visible="False|True"
    OnDataBinding="OnDataBinding event handler"
    OnDisposed="OnDisposed event handler"
    OnInit="OnInit event handler"
    OnLoad="OnLoad event handler"
    OnPreRender="OnPreRender event handler"
    OnUnload="OnUnload event handler"
    />

Remarks

The HtmlMeta control provides programmatic access to the HTML meta element on the server. The meta element is a container for data about the rendered page, but not page content itself. The meta tag is placed between the opening and closing head elements. Each meta element describes a metadata property name and its associated value.

Example

The following code example demonstrates how to use the HtmlMeta control declaratively. This <meta> element lists keywords describing the Web page, which could be used by a search engine.

<head runat="server">
  <title>HtmlMeta Control</title>
    
  <meta id="Meta1" content="page keywords" 
      name="keywords" runat="server" />  
</head>
<head runat="server">
  <title>HtmlMeta Control</title>
    
  <meta id="Meta1" content="page keywords" 
      name="keywords" runat="server" />  
</head>

See Also

Reference

HtmlMeta

Other Resources

HTML Server Controls