Meta tags are very much important for you web page, search engine use Meta tags to index you site. So some time we need to change meta tags dynamically in case of dynamic pages in asp.net
protected void Page_Load(object sender, EventArgs e)
{
HtmlHead headTag = (HtmlHead)this.Header;
// Set the page title
headTag.Title = "Title of Page";
// Add a Description meta tag
HtmlMeta PagemetaTag = new HtmlMeta();
PagemetaTag.Name = "Description";
PagemetaTag.Content = "Customized Description tag of the page";
headTag.Controls.Add(PagemetaTag);
// Add a Keywords meta tag
PagemetaTag = new HtmlMeta();
PagemetaTag.Name = "Keywords";
PagemetaTag.Content = "Customized Keyword tag of the page";
headTag.Controls.Add(PagemetaTag);
}
protected void Page_Load(object sender, EventArgs e)
{
HtmlHead headTag = (HtmlHead)this.Header;
// Set the page title
headTag.Title = "Title of Page";
// Add a Description meta tag
HtmlMeta PagemetaTag = new HtmlMeta();
PagemetaTag.Name = "Description";
PagemetaTag.Content = "Customized Description tag of the page";
headTag.Controls.Add(PagemetaTag);
// Add a Keywords meta tag
PagemetaTag = new HtmlMeta();
PagemetaTag.Name = "Keywords";
PagemetaTag.Content = "Customized Keyword tag of the page";
headTag.Controls.Add(PagemetaTag);
}
No comments:
Post a Comment