Wednesday, March 28, 2012

ViewState

Hi,

Is there any way to turn off ViewState (for real) using the ScriptManager and UpdatePanel? I have EnableViewState on both set to false, but Im still seeing responses of about 100k.

Thanks

Joe

set the enableviewstate=false.

then use ctl+F5 for clear the cached output


Tried that, but it didnt make a difference (unless you are talking about at the page level, in which case I cant without fairly significant changes to things unrelated to what Im working on)

Thanks,
Joe


The EnableViewState property of the ScriptManager only refers to the ViewState of the particular ScriptManager control itself.

Due to the underlying way that UpdatePanels work, the full page's ViewState must be sent to the server. The full page life cycle is still executed in a partial postback, so the ViewState is necessary to re-instantiate the state of the page and it's controls.

However, you canuse page methods to avoid the data-heavy partial postbacks in many cases. The best solution really depends on what exactly you're trying to do, but there's unfortunately no way to remove the ViewState from partial postbacks.

No comments:

Post a Comment