using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;

public partial class AddMetaTageProgrammatically : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        // Adding Title
        Page.Title = "How to add meta tags programmatically.";

        //Adding Meta Descriptions
        HtmlMeta oHtmlMetaDescription = new HtmlMeta();
        oHtmlMetaDescription.Name = "description";
        oHtmlMetaDescription.Content = "How to add meta tags programmatically in asp.net with c#.";
        Page.Header.Controls.Add(oHtmlMetaDescription);
        oHtmlMetaDescription = null;

        //Adding Meta Keywords
        HtmlMeta oHtmlMetaKeywords = new HtmlMeta();
        oHtmlMetaKeywords.Name = "keywords";
        oHtmlMetaKeywords.Content = "meta tags, adding meta tags programmatically, meta tags in asp.net";
        Page.Header.Controls.Add(oHtmlMetaKeywords);
        oHtmlMetaKeywords = null;
    }
}