Wizard Recreates Page?

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
 
M

Mark Olbert

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top