eBusiness Help
Try Looksmart PPC Search Marketing
$25 in Free Clicks for New Advertisers
45 Days Free Hosting From Rackspace
Move at your own pace and save with an 18 mo. contract
CounterSpy Enterprise Free Trial
Detect, delete and 'Active Protect' against over 30 categories of malware

Free Software Archive:
Enterprise and Home Networking Downloads

Recent Articles

How to Use AdRotator Control in ASP.Net?
Adrotator control is available in ASP.Net to make the task of rotating the advertisement images in a web form quick and easy.

Using a Custom Base Class for your ASP.NET Page's Code-Behind Classes
One of the many benefits of object-oriented programming is that it allows for reuse of logic. For example, classes can be created that contain a base level of functionality.

Cisco Snatches Sheer Networks for $97 Million
Networking mammoth Cisco Systems announced the purchase of Sheer Networks based in San Jose, California.

Syndicating Your Web Site's Content with RSS and ASP.NET
About a year ago I wrote an article titled, Syndicating Your Web Site's Content with RSS.

Remote and Local ASP Debugging Tool
Debugging ASP (Active Server Pages) can be a real challenge these days.


11.11.05


Optimize ASP.NET Pages By Reducing The Size Of The VIEWSTATE

By Manoj Mansukhani

One way to optimize the pages you develop with ASP.NET is to keep a check on the view state of the page and the controls that are added to the page.

Any seasoned developer of ASP.NET will remember the VIEWSTATE which is added to every page in a hidden field _VIEWSTATE and contains base64 encoded data which could be any where from 800 to tens of thousands of characters long depending on your usage of this property on your page.

There are many issues with view state in ASP.NET 1.x. It is on by default, and unless you know to look for it and disable it when it is not needed, it can significantly increase the amount of data rendered by your page. This becomes particularly painful when you use data-bound controls, all of which use view state to save their state across post backs.

Direct Access to Monster on Your Desktop.
Post jobs on Monster in minutes - Hear from local candidates the same day

You need to ensure that you only use the VIEWSTATE property for the page and controls where necessary so that the size of the value for the hidden field of _VIEWSTATE is minimum. This will ensure that your page loads fast and that the search engines can retrieve the actual content of your page.

Some search engines only read a certain set of characters from the top (that's why you have most SEO specialists mentioning that you should have your keywords on the top of the page) and the bottom of the page. If the value of the hidden field of _VIEWSTATE is long on your page then these search engines would not be able to get to the actual content of your page as a result it would never map the keywords (keywords density) and you would have a low ranking on these search engines.

How to decrease the size of the view state?

a. As mentioned before the VIEWSTATE for any page is set to TRUE by default. If you do not require the controls or the page to hold the VIEWSTATE you can disable the VIEWSTATE for the page completely by adding the directive to the page. (Usually if you have a page that does not post back to itself you can disable the VIEWSTATE on these pages.)


b. You can selectively disable the VIEWSTATE of the controls, datagrids etc that you use on the page if these controls do not post back to the same page.

You will see a considerable difference in the page size and the loading time of the page once you disable the VIEWSTATE of the controls or the page. This will also be evident from the size of the base64-encoded string in the value field of the hidden field of _VIEWSTATE. By disabling the VIEWSTATE for a couple of datagrid controls on one of the pages of our clients website, we were able to reduce the VIEWSTATE of the page from 10,000 characters to 1000 characters and the page size also reduced by a few kilobytes (KB).


About the Author:
Manoj Mansukhani is the founder and CEO of Scarlet Technologies (http://www.scarlettech.com). They provide services to help business get setup and succeed online. Their services include online marketing, search engine optimization, increasing website conversion rates and web development. Visit the website or contact him to find out how you can succeed online.

About WebProASP
WebProASP is a collection of up to date tutorials and insightful articles designed to help ASP users of any skill level implement successful ASP systems and practices. ASP Strategies and Tactics for Business

WebProASP is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQlProNews.com
ITcertificationNews.com SysAdminNews.com
WebProASP.com WirelessProNews.com
CProgrammingTrends.com ITManagementNews.com



-- WebProAsp is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2005 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article



">Unsubscribe from WebProAsp.
To unsubscribe from WebProAsp or any other iEntry publication, simply send an email request to: support@ientry.com

ASP Strategies and Tactics for Business WebProASP News Archives About Us Feedback WebProASP Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact