With the ASP.NET 4.0 release round the corner, I thought of starting an article series that covers the new features introduced in ASP.NET 4.0, one at a time. This article is Part I of this multi-part series.
In this article we will learn 2 new properties added to Pages Class.
The MetaDescription is important from an SEO perspective. The META Description Tag is an integral part which identifies a page and irrespective of the contrary belief, I think search engines take this meta tag seriously.
Now in ASP.NET 2.0/3.5, you could use the HTMLMeta class to define HTML <meta> elements for your page as shown below:
Too much code!
However in ASP.NET 4.0, you now have two new properties added to the Page class – MetaKeywords and MetaDescription.
In order to retain the older meta tag contents and also use the new ones, just concatenate the two programmatically as shown below: