Monday, March 14, 2011

To change meta element in asp.net using the HtmlGenericControl class


HTMLGenericControlClass.aspx

<%@ Page Language="C#" %>  
 <script runat="server">  
    protected void Page_Load(object sender, System.EventArgs e)  
    {  
        if (!Page.IsPostBack)  
        {  
            Meta1.Attributes["name"] = "description";  
            Meta1.Attributes["content"] = "huge asp.net examples with images";  
        }  
    }  
</script>  
  
<html xmlns="http://www.w3.org/1999/xhtml" >  
<head id="Head1" runat="server">  
    <title>How to change meta element in asp.net using the HtmlGenericControl class</title>  
    <meta id="Meta1" runat="server" />  
</head>  
<body>  
    <form id="form1" runat="server">  
    <div>  
        <h2 style="color:Navy; font-style:italic;">HtmlGenericControl Class Example: change meta element</h2>  
          
    </div>  
    </form>  
</body>  
</html>  

No comments: