.NET 3.5 SP1 ships with some extra functionality which allows you to optimize your ASP.NET pages for search engines. Basically it means less hacking and more control about the generated markup.
Steve Smith has just posted an article about using standard ASP.NET functionality to optimize ASP.NET pages for search engines. Steve wrote that .NET 3.5 SP1 allows you to control where in the page the ASP.NET hidden fields (eg. __VIEWSTATE) are being rendered: at the top or at the bottom of the HTML body. Including that setting as a part of the framework means no more hacking and using custom HttpModules in order to rewrite the generated HTML and to move hidden fields markup to the bottom of the page. Using a single setting in the web.config you can decide where do you want ASP.NET to render the state fields.
It’s been a dream of many ASP.NET developers to have more control over the generated HTML markup. Comparing to other web development languages, where you have full control over the HTML, ASP.NET hides some of the markup from you. On one hand it enables us – ASP.NET and SharePoint developers to create web applications and web sites faster by using the standard components. On the other hand however, in cases where it’s all about control and sticking to web standards, ASP.NET doesn’t provide enough control about the generated HTML.
I’m not sure if the renderAllHiddenFieldsAtTopOfForm setting is the beginning of a new trend by the ASP.NET team, but it would be great if it was. Once and for all it would level ASP.NET with other web development platforms when it comes to control over the generated markup. Considering the great flexibility and lot’s of standard controls it would make ASP.NET even greater web development platform.
So what does it have to do with SharePoint?
Office SharePoint Server 2007 is built on top of ASP.NET. Given such flexibility on ASP.NET level, means that you could actually move all the standard ASP.NET and SharePoint generated hidden fields to the bottom part of the page HTML, what means showing the content to the visitors quicker and providing more relevant content to the search engines instead of some cryptic markup.
I hope that the ASP.NET team will provide more of such flexibility in the future allowing us to build better and more Internet-ready solutions in both ASP.NET and SharePoint 2007.