Interview Question in Asp.net 2.0


 

Interview Question :: Does ViewState affect performance? How can you compress a viewstate?

 Does ViewState affect performance? What is the ideal size of a ViewState? How can you compress a viewstate?

by ksk
VoteNowAnswers to "Does ViewState affect performance? How can you compress a viewstate?"

 Viewstate stores the state of controls in HTML hidden fields. At times, this information can grow in size. This does affect the overall responsiveness of the page, thereby affecting performance. The ideal size of a viewstate should be not more than 25-30% of the page size.

Viewstate can be compressed to almost 50% of its size. .NET also provides the GZipStream or DeflateStream to compress viewstate.

by ksk