Monday, March 14, 2011

To set change meta keywords programmatically


ChangeMetaElement.aspx 

<%@ Page Language="C#" %>  
<script runat="server">  
    protected void Page_Load(object sender, System.EventArgs e)  
    {  
        if (!Page.IsPostBack)  
        {  
            Meta1.Attributes["name"] = "keywords";  
            Meta1.Attributes["content"] = "asp.net, example, tutorial, web, web design, web development";  
        }  
    }  
</script>  
  
<html xmlns="http://www.w3.org/1999/xhtml" >  
<head id="Head1" runat="server">  
    <title>How to set change meta keywords programmatically in asp.net</title>  
    <meta id="Meta1" runat="server" />  
</head>  
<body>  
    <form id="form1" runat="server">  
    <div>  
        <h2 style="color:Red; font-style:italic;">Meta element Example: How to change meta keywords</h2>  
          
    </div>  
    </form>  
</body>  
</html>

No comments: