[2005] Why can't I disable viewstate?
I have a page that contains a lot of data (client insists they don't want paging on this page) and the generated page contains between 4-5Mb of Viewstate data.
I don't need to keep anything in viewstate and have set EnableViewState="false" at the page level, control level and temporarily on the MasterPage.
Yet my page is still generating a 4Mb viewstate field, what can I do to stop this?
Re: [2005] Why can't I disable viewstate?
Re: [2005] Why can't I disable viewstate?
Excellent.
Isn't this a bit heavy handed though? I know if a method works it sometimes best to just go with it but part of me wants to just keep banging my head against the wall to figure out why something that should work doesn't.
Re: [2005] Why can't I disable viewstate?
The viewstate is there just in case you want to use features that use viewstate. The logic for it is, if you'r using ASP.NET, you will want to use one of its richer features at some point. Hence, the viewstate. Yes, it adds to the page size but it's something of a tradeoff since bandwidth is more 'available' now.
Re: [2005] Why can't I disable viewstate?
So enableViewstate=false is meaningless?
Re: [2005] Why can't I disable viewstate?
Not necessarily, part of the viewstate that you cannot control through attributes like that is the control tree structure on the page, among other things which I am not fully aware of. But I did mention the control tree structure to appear smart to you. Impressed yet?
Re: [2005] Why can't I disable viewstate?