Welcome to WebProNews Breaking eBusiness and Search News
Advertise | Newsletter | Sitemap | News Feeds News Feed 
 WebProNews Search Part of the iEntry network iEntry inc. 

ASP.NET: HttpModule For Moving ViewState To Bottom

Mads Kristensen
Expert Author
Published: 2006-11-28

WebProNews RSS Feed

There are two reasons why it is desirable to do so.

The first is for letting search engines see more of your content rather than the big portion of ViewState many sites have.

The other is perceived rendering time, which means that the content loads faster because it renders before the ViewState while the total rendering time remains the same.

That will decrease the load time of your website's content.

Techniques to move the ViewState to the bottom of the WebForm has been published many times before.

What I wanted was adding the functionality to an HttpModule.

The technique to move the ViewState is borrowed from Scott Hanselman while the HttpModule implementation is my own.

As Scott writes, it is a very low impact technique (0.000995 second) even though it hasn't been fully tested for a variety of scenarios.

The goal I'm trying to achieve is to build a reusable component that has 100% plug ‘n play capabilities.

That's where the HttpModule comes in.

You can just drop it into any existing website without changing any code.

I see no reasons why not to move the ViewState to the bottom, which makes me believe that Microsoft should have done that by default in the first place.


Download the ViewstateModule.cs below and put in the App_Code folder of your website. Then add these lines to the web.config and you're ready to go.


   <add type="ViewstateModule" name="ViewstateModule" />



ViewstateModule.zip (1,06 KB)


Add to Del.icio.us | Digg | Reddit | Furl

Bookmark WebProNews:

View All Articles by Mads Kristensen

Receive Our Daily Email of Breaking eBusiness News

About the Author:
Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.


WebProNews RSS Feed

More Expert Articles Articles

Contact WebProNews


Targeted Information for Business
WebProNews is part of the iEntry network

Internet Business: Marketing: Small Business:
WebProNews MarketingNewz SmallBusinessNewz
WebProWorld AdvertisingDay PromoteNews
EcommNewz SalesNewz EntrepreneurNewz

Software: Search Engines: Web Design:
WebMasterFree Jayde B2B DesignNewz
NetworkingFiles SearchZA FlashNewz
SecurityConfig SearchNewz WebSiteNotes

Developer: IT Management: Security:
DevWebPro ITManagement SecurityProNews
DevNewz SysAdminNews SecurityConfig
TheDevWeb NetworkingFiles NetworkNewz

The iEntry Network consists of over 100 web publications reaching millions of Internet Professionals. Contact us to advertise.
 Advertise | Contact Us | Corporate | Newsletter | Sitemap | Submit an Article | News Feeds
 WebProNews is an iEntry, Inc. ® publication - $line) { echo $line ; } ?> All Rights Reserved
Ten most recent posts.

The official blog of WebProNews.

Go to WebProBlog

Featured Software

About WebProNews
WebProNews is the number one source for eBusiness News. Over 5 million eBusiness professionals read WebProNews and other iEntry business and tech publications.

WebProNews provides real-time coverage of internet business.

Free Email Newsletters:
WebProNews SearchNewz
WebProWorld DevWebPro
Marketing SecurityNews
Plus over 100 other newsletters!

Send me relevant info on products and services.

iEntry.com WebProWorld RSS Feed WebProWorld Contact WebProNews Print Version Email a friend Bookmark us SearchBrains.com SearchBrains RSS Feed