meta tags contain useful information that could be used by user’s browser, search engine optimization, Java Script and etc. Some of the most common ones are "keyword" and "Description" meta tags which are used for better optimization.
Changing/Adding these meta tags is particularly useful if you display different data according to user’s setting or your application setting, e.g. if you have more than one language and want to have a different keyword meta tag for each language.
Here is how to add meta tags to your site programmatically:
HtmlMeta htmlMeta = new HtmlMeta();
htmlMeta.Name = "keywords";
htmlMeta.Content = "Tips, Silverlight Tips, SilverlightTips.com";
Page.Header.Controls.Add(htmlMeta);
Above code will generate the following code in your .aspx file:
<meta name="keywords" content="Tips, Silverlight Tips, SilverlightTips.com" />
Posted by Damon Serji on
22. September 2009 17:39 under:
Intermediate