C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Application Performance - Viewstate


Posted Date: 29 Aug 2008    Resource Type: Articles    Category: .NET Framework

Posted By: Nagarajan       Member Level: Gold
Rating:     Points: 5



Viewstate is used primarily by server controls to retain state only on pages that post data back to themselves. The information is passed to the client and read back in a specific hidden variable called _VIEWSTATE.

You are not going to read about What & Why viewstate here, but how it affects the performance

As the view state grows larger it affects performance.Very large viewstate affects the efficiency of garbage collection,increses the CPU cycles and last but not least, your page takes longer time to download and render, which is not really accepted in all cases especially when you have a slow connection or a dial up connection.

Disable view state if you do not need it:
Make sure that you evaluate each page (in both page and control scope) to determine whether you need view state to be enabled or not. Viewstate adds overhead to each request. The couple of things that need to be higly considered in this overhead is the increased page sizes sent to the client as well as a serialization and deserialization cost.

Minimize the number of objects you store in viewstate:
You do not need viewstate under the following conditions:
-The page does not post back to itself; the page is only used for output and does not rely on response processing.
-Your page’s server controls do not handle events and you have no dynamic or data-bound property values (or they are set in code on every request).
-If you are ignoring old data and repopulating the server control every time the page is refreshed.

Determine the size of your view state:
You need to evaluate your use of viewstate for each page. To determine a page’s viewstate size, you can enable tracing and see each how each control uses it. Disable viewstate on a control-by-control basis.

Its really important to take care to reduce the size of your view state.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Viewstate  .  Asp.Net Viewstate  .  Asp.Net  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: C# Language
Previous Resource: Application Performance - Caching
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use