ASP.NET Meta Keywords and Description
- by Ben Griswold
Some of the ASP.NET 4 improvements around SEO are neat. The ASP.NET 4 Page.MetaKeywords and Page.MetaDescription properties, for example, are a welcomed change. There’s nothing earth-shattering going on here – you can now set these meta tags via your Master page’s code behind rather than relying on updates to your markup alone. It isn’t difficult to manage meta keywords and descriptions without these ASP.NET 4 properties but I still appreciate the attention SEO is getting. It’s nice to get gentle reminder via new coding features that some of the more subtle aspects of one’s application deserve thought and attention too.
For the record, this is how I currently manage my meta:
<meta name="keywords"
content="<%= Html.Encode(ConfigurationManager.AppSettings["Meta.Keywords"]) %>" />
<meta name="description"
content="<%= Html.Encode(ConfigurationManager.AppSettings["Meta.Description"]) %>" />
All Master pages assume the same keywords and description values as defined by the application settings. Nothing fancy. Nothing dynamic. But it’s manageable. It works, but I’m looking forward to the new way in ASP.NET 4.