Wizard Recreates Page?

  • Thread starter Thread starter Mark Olbert
  • Start date Start date
M

Mark Olbert

I'm running into a weird problem debugging an ASPX page that contains a Wizard.

The problem is that I need to access the state of a control (e.g., the selection status of CheckBoxList items) after clicking Next
to take me away from the WizardStep where the control is located.

What happens is that the page instance gets recreated, so naturally the state of the control I'm interested in gets reset to its
default values. I've verified that the page instance gets recreated by using the following approach:

public partial class page_class
{
private static int lastID = 0;

private int instanceID = -1;

public page_class()
{
instanceID = lastID++;
...
}
....
}

Monitoring the value of instanceID shows that it's not the same after the Next Step event gets handled as it is before it's handled.

So how do I persist the state of the controls from a WizardStep once I move off of it??

- Mark
 
Okay, never mind, I solved it. I had created some initialization and storage methods to handle entering and exiting the steps, and
they used delegates to instance methods. Which meant when they were called, they operated on the page class instance that existed
when the delegate was first assigned. Ouch!

- Mark
 
Back
Top