ASP.Net Wizard Control, DataBinding, ViewState and PostBacks

asp.net

I have a Wizard Control that has a user control for each step. Of course, on the first step IsPostBack is false when the page first loads. But when going to the next step IsPostBack is always true. What is the best pattern for figuring out when to databind each control within a step and maintaining viewstate when going from step to step since you can't use IsPostBack? I might add that user controls within the Wizard are bound to DataSource in code, not as part of the ascx markup.

Best Answer

If you databind a control which has viewstate on first page load then you will not need to databind again on postback.