Saturday, April 16, 2011

How to add META keywords and Description in ASP.NET

HtmlMeta metaDesc = new HtmlMeta();

metaDesc.Name = "description";

metaDesc.Content = "Tips on roasting coffee at home";
Page.Header.Controls.Add(metaDesc);

HtmlMeta metaKey = new HtmlMeta();
metaKey.Name = "keywords";
metaKey.Content = "roast, coffee, home, tips";
Page.Header.Controls.Add(metaKey);



<meta name="description" content="Tips on roasting coffee at home" />
<meta name="keywords" content="roast, coffee, home, tips" />

No comments:

Post a Comment