I am using a Wizard control with 5 steps. On step 2 the user is
present with a radiobuttonlist with two listitems in it. If the first
radiobutton is selected I want to take the user to step 3, if the
second is selected I want to take the user to step 4. I have the
OnActiveStepEve nt that fires on every step and the code looks like
this:
if (Wizard.ActiveS tepIndex == 2)
{
switch (RadioButtonLis t.SelectedValue )
{
case "2":
Wizard.ActiveSt epIndex = 2;
break;
case "3":
Wizard.ActiveSt epIndex = 3;
break;
}
}
I also have the following code
if (Wizard.ActiveS tepIndex == 3)
{
Preforming some logic here
Wizard.ActiveSt epIndex = 4;
}
Here is the problem. If case = 2 the first if statement takes the user
is taken to ActiveStepIndex = 2 (Step 3) just like it is supposed to.
When the user then clicks 'next' the second if statement becomes true,
some logic is preformed and the user gets taken to ActiveStep = 4
(step 5).
However, if case = 3 the first if statement takes the user to
ActiveStepIndex = 3 (step 4) BUT that steps get skipped since the
second if statement now becomes true and the user gets taken to
ActiveStep = 4 (step 5) right away instead. In addition I get an error
since the the logic performed in the second if statement is only
supposed to be executed if case = 2.
Is there a way to solve this problem in some nice, clean way?
Thanks