Saturday, March 24, 2012

Wizard Control

I am using the Wizard Control in an aspx page inside an Update Panel control. What I want to do is to navigate to this page and set which Wizard Step should be active dynamically. Something like :

if(Request["whichstep"]!=null)

Wizard1.ActiveStepIndex=int.Parse(Request["whichstep"]);

Now this works fine in that the correct Wizard step is shown when the page is loaded. But the problem is that the Wizard gets STUCK on this step. i.e. you can't use the previous/next navigation buttons to move forward or backwards.

Any help would be greatly appreciated (PS. we also tried taking the Update panel out, but the same problem exists).

HN.

can you post your code? where in your code are you checking the wizard activestepindex?

Hi boolie,

Thanks for taking the time.

The code is very simple. The page that is calling the page with the Wizard has button and its click event has Response.Redirect("WizardPage.apsx?step=3");

The page that has the Wizard on it checks on the Page_Load : if(Request["step"]!=null) Wizard1.ActiveStepIndex=Int32.Parse(Request["step"]);

As I mentioned, this works. The wizard shows the correct step. But the problem is that you can't navigate i.e. go backward or forwards using the previous/next buttons.

By the way I tried putting the code in various other events that is raised by the Wizard, they all have the same behaviour!


not sure this will fix the problem, but at least it might help eliminate some things to troubleshoot...

Are you checking for whether or not it's a postback before running the "if(Request["step"]!=null)..."?

something like this:

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//code would go here...
}
}

if you haven't tried this, test it and see if you notice any difference. What might be happening is that when you click on "Next" or "Previous" it's causing the page to reload which would cause the Page_Load code to run again which would show you the same step. I could be completely wrong, but at least we'll have one troubleshooting step out of the way. Let me know what happens.



Sorry. But I should have mentioned that I do test the Postback in my last Post and it still gets Stuck. Is this some kind of Bug in the Control do you think? After all they are only panels that get their visibility changed!
I kind of thought you might be checking that already. honestly, i have no idea whether or not it's a bug, but it does seem pretty strange. i'll try some tests on my own and see if i can duplicate the problem and then maybe i can help find a solution
Many Than

Many Thanks.

Looking forward to your findings.

No comments:

Post a Comment