Showing posts with label step. Show all posts
Showing posts with label step. Show all posts

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.

Wizard inside of update panel, still getting postbacks

Hi,

I placed a wizard inside of an update panel and when I click on the button for the next step, I still get a postback. I have tried setting the mode to conditional and it still occurs.

I even tried making a new atlas website and putting nothing but the update panel with the wizard inside and it still does not work. Here is the code below. Any idea what I am doing wrong??

<atlas:ScriptManagerID="ScriptManager1"runat="server"/><div><atlas:UpdatePanelID="UpdatePanel1"runat="server"Mode="Conditional"><ContentTemplate><asp:WizardID="Wizard1"runat="server"><WizardSteps><asp:WizardSteprunat="server"Title="Step 1"></asp:WizardStep><asp:WizardSteprunat="server"Title="Step 2"></asp:WizardStep></WizardSteps></asp:Wizard></ContentTemplate></atlas:UpdatePanel>

Hi,

it seems that you are not setting EnablePartialRendering="True" in the ScriptManager control.

Yes you are right. In the sample code I pasted that was the problem (and I feel very stupid). However in my actual code I did remember to set partial rendering to true.

Now, that being said, I think I figured out what was wrong, and hopefully the Atlas guys watching this forum can tell us if I am correct.

A little more background on the page first, it is a content page and the master page has a flash banner on it that I put their using the asp.net 2.0 flash control. On my developoment machine I didn't have the flash file it was pointing to. Instead of throwing an exception when I view the page in my browser it just kept perpetually loading the page.

It occured to me that the update panel may not work properly if the page had never completed loading before a postback was called. All I had to do was copy the flash file from the webserver to my development system and VOILA! The page loads, the update panel works.


Hi,

glad to hear that you solved it :) I'll bookmark this post for future reference.