Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3323654
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:19:42+00:00 2026-05-17T23:19:42+00:00

I have an asp:wizard control that contains five WizardSteps. All of these steps have

  • 0

I have an asp:wizard control that contains five WizardSteps. All of these steps have form controls, and most of these controls have validators. When the user steps through the wizard with the next and previous buttons everything is working great, and validation triggers as it should. However, if the user chooses to navigate the wizard using the links in the SideBar, he or she could skip some of the steps. When the last page is submitted (which is a summary page) there might be controls in the wizard that are invalid.

What I want to do is to check the state of all controls (or run all validators) when the user clicks the finish button, or when the user enters the summary page. I have made an attempt to run all the validators in the FinishButtonClick event by doing this:

bool validates = true;
foreach (IValidator validator in this.Validators) {
    validator.Validate();
    if (!validator.IsValid) {
        validates = false;
    }
}

e.Cancel = !validates;

But when I do this every validator claims that they are valid. I have also tried to set all controls to Visible = true; prior to this code block, but this has no effect. Any idea what could be wrong? Or is it a better way of doing this, maybe a native function to the wizard control that I’m missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:19:42+00:00Added an answer on May 17, 2026 at 11:19 pm

    You can’t do this because the controls that you are trying to validate are not rendered on the page. i.e. the validators are not there, so Page.Validate() and Page.IsValid will return true because there are no validators, so everything is valid. Makes sense, I hope?

    Go to View Source and you will see that the source only contains markup for the current step of the wizard. So any validators on previous pages are not rendered and hence not checked.

    I would suggest hiding the SideBar. That way the user cannot skip pages and when they click ‘Next’ the current controls will be validated, so they can only continue if they have completed the page that they are on.

    P.S. You don’t need to loop through all validators and check they are valid. Just use Page.Validate() (you can even pass a ValidationGroup to this method) and then check the Page.IsValid boolean.

    EDIT:
    As per comments below:

    Page Property:

    public bool PageOneValid
    {
        get
        {
            if (ViewState["PageOneValid"] == null)
                return false;
    
            return (bool)ViewState["PageOneValid"];
        }
        set
        {
            ViewState["PageOneValid"] = value;
        }
    }
    

    On page one next click or sidebar click:

    Page.Validate("PageOne");
    PageOneValid = Page.IsValid;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have wizard control with multiple steps. something like this <asp:wizard> <wizardsteps> </wizardsteps> <wizardsteps>
I have an ASP.NET form with multiple steps (using the Wizard control). When advancing
I have an ASP.NET wizard control where I loop back, wiz.MoveTo(wiz.WizardSteps[0]) , to the
I have an ASP.NET site that uses a standard, wizard created login control. I
I have an ASP.NET page with a Wizard control containing several pages of form
I have a <asp:Wizard> control with 6 or so steps. In the first 3
I have a asp:Wizard control on a site running Framework 3.5. I acquired the
I have an asp wizard on my page with three steps. <asp:Wizard ID=wizardBestellen runat=server
I have a wizard setup like so: <asp:Wizard ID=Wizard1 runat=server DisplaySideBar=false onnextbuttonclick=OnNextButtonClick> <WizardSteps> <asp:WizardStep
Happy Friday All, I have an ASP.net 2.0 website that I'm updating to .Net

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.