asp.net form "MoveNext" button to go to specific step based on user input

I have an asp.net form that has about 7 steps. I need help with code for step skipping. The scenario:

On step 1, I have a a few radio input controls. Now, based on the radio answer selection in step 1 I want my <asp:ImageButton ID="ContinueButton0" runat="server" CommandName="MoveNext" ImageUrl="continue.jpg" /> to go to a specific step.

Lets say user answers Yes for radio question 1 in step 1, then "MoveNext" goes to step 2. But if user answers No for radio question 1 in step 1, then "MoveNext" goes to step 3.

Also I'd like to have "MovePrevious" go back to the last step the user was in. For example, if user went from step 1 to step 3 because of his answer selection, if user clicks go back ("MovePrevious") it should take him back to step 1, not to step 2.

I've been stuck trying to do this forever >.<

Thanks so much ahead of time!!! :D
igotstehsolutionAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

robastaCommented:
Are you using the wizard control? [http://weblogs.asp.net/scottgu/archive/2006/02/21/438732.aspx], if not, i suggest you do.
0
igotstehsolutionAuthor Commented:
Yes, I am using <asp:wizard>, which means each step is in a <asp:WizardStep>
0
robastaCommented:
Do something like this (depending on your control IDs)

 protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
        {
         if (CheckBox1.Checked && e.CurrentStepIndex == 2)
            {
                Wizard1.MoveTo(WizardStep3);
            }
        }

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

igotstehsolutionAuthor Commented:
my control is: <input type="radio" id="websiteYes" onclick="slidedown('webAdd'); slidedown('webUpgAns');" name="website" />Yes


so I have:

protected void ContinueButton0_Click(object sender, ImageClickEventArgs e)
    {
        if (websiteYes.Selected)
        {
            Wizard1.MoveTo(WizardStep3);
        }
    }



But it says 'websiteYes' does not exist in the current context.

It is the ID for the input control though so I don't understand why =/
0
drypzCommented:
Hi! You may add runat='server' attribute. Something like

<input type="radio" runat="server"  id="websiteYes" onclick="slidedown('webAdd'); slidedown('webUpgAns');" name="website" />
0
igotstehsolutionAuthor Commented:
thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.