Developers blog, .NET, C#, VB.NET, ATLAS, AJAX, WWF, ORM, LINQ, ARCHITECTURE and more by Frank Kroondijk |
|
ProfileFrank KroondijkSoftware developerSoftware architectBlog profile
Links
Archives
200 feeds |
dinsdag, juli 18, 2006Dynamic metadata
Saw some plp asking how to set metadata dynamically, well here the answer:
//*** page title *** this.Page.Title = "http:\\dotnetpret.blogspot.nl"; myHeadDummy.Text = "\n"; this.Page.Header.Controls.Add(myHeadDummy); //*** page keywords *** HtmlGenericControl Keywords = new HtmlGenericControl("meta"); Keywords.Attributes.Add("NAME", "Keywords"); Keywords.Attributes.Add("CONTENT", "c#,.Net,dotnet,ASP.NET") this.Page.Header.Controls.Add(Keywords); //*** page description *** HtmlGenericControl Description = new HtmlGenericControl("meta"); Description.Attributes.Add("NAME", "Description"); Description.Attributes.Add("CONTENT", 'if its .net its here"); this.Page.Header.Controls.Add(Description); |