Hide Show Step on Wizard Conteol

Posted on 2009-02-18
Last Modified: 2012-05-06

I have a Wizard control and am having trouble hiding some steps depending on what was selected on the first step.

Basically There are 3 steps Step 1, Step 2, Step 3

On Step 1 there are 2 checkboxes ---  chkStep2  and chkStep3

If None of the checkboxes are selected then step 2 and 3 are hidden

If Only chkStep2 is checked and chkStep3 is not checked then only Step 2 is viisible and has a step type of "Finish"

If Only chkStep3 is checked and chkStep2 is not checked then only Step 3 is viisible and has a step type of "Finish"

If both are checked then both steps 3 and step 2 are visible

The "if"  statement is stright forward I am just not sure on what event on the wizard i need to put it on

Thanks for your help

Question by:patelajk
    LVL 5

    Accepted Solution

           don't try to hide.
    based on the first step condition
    navigate directly to the step what you want
    using the

    ActiveStepChanged event

    Author Comment

    Used this code but it doesnt hide corretly and i get this error on some occasions:

    The command 'MoveComplete' is not valid for the previous step, make sure the step type is not changed between postbacks      

    Step 1 = Details
    Step 2 = Trial
    Step 3 = NewsLetter
    Private Sub Wizard1_NextButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles wizSecSellerReg.NextButtonClick
    		If wizSecSellerReg.ActiveStepIndex = 0 Then
    			If chkNewletter.Checked = False And chkTrials.Checked = True Then
    				wizSecSellerReg.ActiveStepIndex = 1
    			End If
    			If chkNewletter.Checked = True And chkTrials.Checked = False Then
    				wizSecSellerReg.ActiveStepIndex = 2
    			End If
    			If chkNewletter.Checked = False And chkTrials.Checked = False Then
    			End If
    		End If
    	End Sub

    Open in new window


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video discusses moving either the default database or any database to a new volume.

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now