ASP.Net - How to generate dynamic meta tags?

Generate dynamic meta tag content - ASP .Net

Here we will learn how to add meta tags dynamically in First of all add the following namespace references:

using System.Web.UI.HtmlControls;

 C# Code: 

protected void Page_Load(object sender, EventArgs e)
            // set page title
            Page.Title = "How to add meta tags dynamically to .aspx page in";

            //Page description
            HtmlMeta pagedesc = new HtmlMeta();
            pagedesc.Name = "Description";
            pagedesc.Content =",,SQL Server,Web Services,Ajax,JavaScript,JQuery,Gridview articles and examples";

            //page keywords
            HtmlMeta pagekeywords = new HtmlMeta();
            pagekeywords.Name = "keywords";
            pagekeywords.Content = ",C#.NET,GridView,DropDownList,,JavaScript,JQuery,XML";


Right click on your page and select view source in that check for title, description and keywords:

seo, dynamically, meta tag, content, web page, asp .net

All Rights Reserved by Etechpulse © 2015 - 2016
Powered By Blogger

Contact Form


Email *

Message *

Powered by Blogger.