Is ASP.NET ViewState bad for SEO?
Good question. Lets look at the facts:
Background
ViewState is a hidden form field used by Microsoft’s ASP.Net to maintain the state of web controls used to build a page.
In simple terms ViewState remembers if a web control has been modified by a user. This information can then be passed back to the web server when their browser requests another webpage or during a post back request.
So for example ViewState might be used to remember a user’s vote on a Poll web control.
Problem
By default ASP.NET records ViewState data for every web control on a page. Even content that cant be modified and which is essentially “stateless”.
An RSS web control used to display a list of RSS powered links would be one such example.
A page built using multiple controls can often cause the ViewState field to become very large in size.
Issues for SEO
It is the size (in Kb’s) that is the only concern for SEO.
A page which is recording ViewState data for each web control can easily result in a ViewState field of 50-100k. This will greatly increase the size of the overall HTML document file.
Although I believe the concerns raised by some to be unfounded:
- Search Engine crawlers only read the first 100k of a webpage
- Content to code ratio is diluted by a large ViewState field
My experience has shown that Search Engines (especially Google) are increasingly look at site performance and page load times as a significant factor in website rankings.
If all links and content are equal what is better for a user; a fast loading site or a poorly performing one?
Solutions
Although it possible to move the ViewState to the bottom of page this doesn’t reduce the page size.
For that prevention is better than cure and disabling ViewState for unnecessarily Web controls is one of the ways to put your pages on a diet and thus reduce the page download time.
Finding ViewState
The ViewState can easily be seen by clicking “view source” on any webpage that is built using ASP.Net.
Farmers Weekly is one such example.
ViewState plug-in for Firefox
There are a number of plug ins available for Firefox. 2 of the best include:
- ViewState Size which displays the size in kB of webpage using ASP.Net’s ViewState in the status bar of Firefox
- ViewState peeker which can decode and display what is being recorded within the ViewState.
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


Leave a Comment