ASP .NET 2.0 Control State vs ViewState

asp.netviewstate

Is the new ControlState feature only applicable to custom controls or is it available for the standard server controls as well?

That is..can you disable ViewState for an entire page with standard controls like Detailsview, Gridview and would it still work? Does ControlState apply to standard server controls?

Or in order to work with ControlState for standard server controls you have to modify their behavior by creating a new custom GridView/DetailsView?

Best Answer

From the Microsoft Documentation.

Use control state only for small amounts of critical data that are essential for the control across postbacks. Do not use control state as an alternative to view state.

From this you can guess that GridView and other items would not be storing that large of an amount of information in ControlState, so I'm guessing that if you wanted to do it, against Microsoft's recommendation you would have to extend the base control to do it.

Related Topic