Add meta data (keywords, description) dynamicly

by Pieter Brinkman 6. July 2009 06:02

Add meta-data dynamically to your page by adding a HtmlMeta control to your Header. In this example I dynamically add a keyword string to the page.

[code:c#]

string keyWords = "metatags, html, dynamic, generate";

HtmlMeta keywords = new HtmlMeta();
keywords.Name = "keywords";
keywords.Content = keyWords;
Page.Header.Controls.Add(keywords); 

[/code]


You can do the same for other meta-data like description.

  

Tags: , , , ,

ASP.Net | Controls

Comments

7/14/2009 4:00:45 AM #

Beziehung Online

Thank you for the illustration. I'll try putting it on site.

Beziehung Online United States

8/5/2009 6:28:41 AM #

Mark

Nice post! Might come in handy some times.

Mark Netherlands

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About Me

My name is Pieter Brinkman I am Solution Architect for Sitecore in The Netherlands. My interests are mainly ASP.NET, MSSQL and Content Management Systems.

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

RecentComments

Comment RSS

Most comments