ASP.Net Wizard – How to clear contents of web controls

asp.net

I have an ASP.NET wizard control where I loop back, wiz.MoveTo(wiz.WizardSteps[0]), to the first step in the wizard in the FinishButtonClick event handler.

I then also want to clear all content for all controls in the steps?

The problem is that because of viewstate the controls in the wizard steps remember their
values from the previous submission?

I cannot use enableviewstate=false on controls as they need to be able to remember their state (back and forth) between steps?

What is the easiest way to clear the viewstate of all controls only when the FinishButtonClick event occurs?

Thanks!

Best Answer

Is there anything that shouldn't be cleared? If not, the simplest solution is probably to put in a redirect in the click event handler so everything gets reinitialized.

Related Topic