Create Meta Tags Programmatically in ASP.NET 2.0
By Ashish Singhal April 07, 2006
In ASP.NET, we had an option to add head tags in HTML where we could define our Meta tags like keyword and description but in ASP.NET 2.0 if we use master page inheritated page then there is problem to add meta tags. This article explains how you can add meta tags in ASP.NET 2.0.
The following code shows how to add meta tags to a page programmatically.
private void CreateMetaTags()
{
HtmlMeta hm =
new HtmlMeta();
HtmlHead head = (HtmlHead)Page.Header;
hm.Name = "Keywords";
hm.Content = "C#, Csharp, C-sharp, .NET";
head.Controls.Add(hm);
}
Last Updated:Thursday, September 02, 2010By:alferoSource#
with your OpenID.
If you do not know what OpenID is,