Solved

Wizard Control ActiveStepIndex

Posted on 2009-04-04
2
1,295 Views
Last Modified: 2012-08-13
Hello,
I'm getting killed by this wizard control.  I have all the code for my app finished, and can not get the wizard control to behave accordingly.
I have 4 steps, 0-3.  Upon clicking next on step 1, depending on the code output they either go onto step 2 or back to step 1 for additional information.
Everything works fine till here, once the additional information is filled on step 1 and the next button is clicked it will not progress to step 2.  The attached NextButtonClick event is attached.

When coming from step 1B with the additional information and expecting to go to step 2
it will take me back to step 1.
on step 1
testLabel and TestLabel2 are both equal to 2.

so, shouldn't it be moving to step 2 and not get stuck on step 1?
protected void ShoppingCartSteps_NextButtonClick(object sender, WizardNavigationEventArgs e)
        {
            // check the Next Step Index to see where we are, and what we need to do:
            // e.NextStepIndex  == 1; Coming from Shopping Cart Overview
            // e.NextStepIndex == 2; Coming from Mailing and Shipping Address;  Going to:  CC input
            if (e.NextStepIndex == 1)
            {
                // Coming From 'Order Overview'
                // Going to 'Contact Information'
                // set all the variables
                mycookies = new CookieContainer();
                GeoCodes = new ArrayList();
                GeoTexts = new ArrayList();
                GeoPresent = "";
            }
 
            if (e.NextStepIndex == 2)
            {
                if (GeoRadioButton1.Visible == false)
                {
                    // Going to input CC information
                    // if GeoRadioButton1 is not Visible, then we are not coming from Step 1B
                    PostToServer1();
                    string present = CheckForGeoCodes();
 
                    if (present == "present")
                    {
                        // Server sent us back to the same page, to Validate Inside City Limits
                        ShoppingCartSteps.ActiveStepIndex = 1;
                    }
                    else
                    {
                        ShoppingCartSteps.ActiveStepIndex = 2;
                    }
 
                }
                else
                {
                    testLabel.Text = e.NextStepIndex.ToString();
                    ShoppingCartSteps.ActiveStepIndex = 2;
                    testLabel2.Text = ShoppingCartSteps.ActiveStepIndex.ToString();
                    // if GeoRadioButton.Visible is Visible, then we are coming from Step 1B, need to find which
                    // GeoRadioButton is checked
                    // Therefore go to PostTo Server2               
                }
            }

Open in new window

0
Comment
Question by:front71
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24071344
It depends on the checks you have put
>if (present == "present")

May be the values are not as expected.
0
 

Accepted Solution

by:
front71 earned 0 total points
ID: 24071632
I put in some response.writes to make sure the parts of the code I was expecting to run was running ... it turns out, that when I was setting the ActiveStepIndex back to 1 (when it was planning on going to 2), that e.Cancel was being set to true, and the next time the NextButtonClick event was ran, e.Cancel retained it's true setting, and I had to set back to false.  Figured that out when someone suggested I just use e.Cancel to keep them on the current step rather than setting the ActiveStepIndex ... so, I blame Microsoft, having that parameter retain it's value on a new NextButtonClick Event seems kind of logically backwards to me
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question