If I disable ViewState at Page level, will it be remembered for GridView inside the page?
+1
A:
If you disabled ViewState at the Page level all controls on that page will have ViewState disabled (i.e. won't be able to use any of the functionality provided by ViewState). I'm not sure from your question if you want GridView to have ViewState enabled and all other controls be disabled, but if that's what you want to do then you have two options:
- If you are using .NET 4.0 then you can disabled ViewState on the page level and enable it just for the GridView
- If you're using .NET version prior to .NET 4.0 then you have to explicitly disable ViewState for all controls (by adding EnableViewState='false' to all elements) and don't add that for GridView. You cannot disable it on Page level and enable for GridView only.
Marek Karbarz
2010-04-04 17:53:49