Hi,
yesterday i read a very good article about ViewState in ASP.NET.
Currently we are using WebFormsMVP to allow better testability in our project. The framework does presenter binding in OnInitComplete and relies heavily on DataBind expressions e.g.
<asp:Label Text="<%#Model.FirstName%>" runat="server" />
As i understand above article this would put Model.FirstName into ViewState. Because databinding happens late during page lifecycle when viewstate tracking is already enabled.
One option would be to disable ViewState altogether. Are there any other? Remeber, we can't use OnInit or OnInitComplete, because OnLoad is the first event presenters can handle.
Also keep in mind, that i used the label as example. I'm searching a solution that would also work for complex controls.
Thanks.