views:

72

answers:

1

I know that with other properties you can define their default value by using skins. But for some reason they won't let me do this for EnableViewState.

I don't want EVERYTHING set to EnableViewState="false" I just want them to default to false then if I want them to I can go through and enable them manually.

The cleaner the solution the better. I'm hoping to shy away from running some obtrusive function in pageload that disables all viewstates as it's recursive nature could be expensive and in my head it feel obtrusive.

+2  A: 

This is not possible with current version of asp.net, but the new one will from what I remember work exactly like that. Here is a link: http://www.asp.net/LEARN/whitepapers/aspnet4/default.aspx#%5FTOC3%5F2

epitka
Good article, thanks! After I posted this I realized that since ViewState in ASP.NET 3.5 is serialized recursively so if a parent control is disabled but a child control is manually enabled, the enabled viewstate wouldn't take effect because the serializer would never reach it. Glad to see that in 4.0 this issue will be addressed. Thanks!
Adam