Add META keywords and Description in ASP.NET (DigitalColony.com)
Add META keywords and Description in ASP.NET
Here is the syntax for programmatically adding META tags to an ASP.NET 2.0 page.
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);
ASP.NET will render the above code to valid XHTML META tags.
via Add META keywords and Description in ASP.NET (DigitalColony.com).
This entry was posted by admin on February 10, 2009 at 1:02 pm, and is filled under C# and ASP.Net, IT. Follow any responses to this post through RSS 2.0. Both comments and pings are currently closed.
Comments are closed.