[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ASP.net Wizard Validation Groups

Posted on 2009-05-19
5
Medium Priority
?
843 Views
Last Modified: 2012-05-07
I am utilizing a wizard for a registration process.  Each step has a validation group.  When looking at the page, it shows the required fields, however, when clicking on "Next" in the wizard, it does not stop the process until the required fields are filled in.  How do I check the validation group for a step when clicking the "Next button?"  

I tried using the UserWizard_NextButtonClick event, but it did not seem to work.
protected void UserWizard_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
 
 
        if (UserWizard.WizardSteps[e.CurrentStepIndex].ID == "PersonalInfo")
        {
 
            GetValidators("Personal");
        }
}

Open in new window

0
Comment
Question by:Dukster131
[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
  • 3
5 Comments
 
LVL 9

Accepted Solution

by:
VikramMullick earned 1500 total points
ID: 24423863
0
 
LVL 7

Expert Comment

by:NicoJuicy
ID: 24423916
Code behind on the page.


if xx.IsValid then
       go to nextstep
end if

Open in new window

0
 
LVL 1

Author Comment

by:Dukster131
ID: 24424477
This helped for StartNavigationTemplate and One of the StepNavigationTemplates.  I have several steps in the wizard and each one has its own validation group.  How do I distinguish the steps?

Here is what I now have:

<StartNavigationTemplate>
<asp:Button ID="btnPrevious" runat="server" Text="Previous" CommandName="MovePrevious" />
<asp:Button ID ="btnNext" runat="server" Text="Next Step" CommandName="MoveNext" CausesValidation="true" ValidationGroup="Personal" />
</StartNavigationTemplate>
<StepNavigationTemplate>
<asp:Button ID="btnPrevious" runat="server" Text="Previous" CommandName="MovePrevious" />
<asp:Button ID ="btnNext" runat="server" Text="Next Step" CommandName="MoveNext" CausesValidation="true" ValidationGroup="Military" />

</StepNavigationTemplate>
0
 
LVL 1

Author Comment

by:Dukster131
ID: 24425471
Ok.  I think I got it.  I used the following in the code behind and it seemed to work.

if (UserWizard.WizardSteps[e.CurrentStepIndex].ID == "MoreInfo")
        {

            Page.Validate("More");
        }
        if (UserWizard.WizardSteps[e.CurrentStepIndex].ID == "Experience")
        {

            Page.Validate("Experience");
        }
        if (UserWizard.WizardSteps[e.CurrentStepIndex].ID == "MilED")
        {

            Page.Validate("MilEd");
        }
        if (!Page.IsValid)
        {
            e.Cancel = true;
        }

Thanks for pointing me in the right direction.
0
 
LVL 1

Author Closing Comment

by:Dukster131
ID: 31583087
Thanks for pointing me in the right direction
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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

649 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