Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created wizard in my project and it has 6 active step index starting from 0, I have displayed the sidebar too in it.

But When the user jump from sidebar 0 to 6, it jumps from 0 to 6 skipping all the requiredfield between 1-5.

I want to put a restriction so that for the first time he should move from activestepindex 0 to 6 by order.

once he clicked all the wizardsteps he can jump anywhere he want.


Thanks,
Sathish
Posted

1 solution

Hi,
you can do it like this.
ASP
<style>.sidebar
{
    display:none;
}
</style>
// add style to NavigationButtonStyle and SideBarButtonStyle it will hide those side bar
<asp:wizard id="Wizard1" runat="server" navigationbuttonstyle-cssclass="sidebar"
        SideBarButtonStyle-CssClass="sidebar" ActiveStepIndex="0">
    <WizardSteps>
        <asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
            //all your design after then one button
            <asp:Button ID="btnNext" Text="NextStep" OnClick="btnNext_Click" runat="server" />
        </asp:WizardStep>
        <asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2">
            //all your design after then one button
            <asp:Button ID="btnNext1" Text="NextStep" OnClick="btnNext1_Click" runat="server" />
        </asp:WizardStep>
    </WizardSteps>
</asp:wizard>

C#
protected void btnNext_Click(object sender, EventArgs e)
{
    // all your desired code for example save your first step data
    Wizard1.ActiveStepIndex++; // go to 2nd step
}
protected void btnNext1_Click(object sender, EventArgs e)
{
    // all your desired code for example save your first step data
    Wizard1.ActiveStepIndex++; // go to 3rd step
}

I have create only two wizard steps but you can create as per your need, and follow this logic.

Hope it helps you.
Thanks.
 
Share this answer
 
v5
Comments
sathish kumar 24-Oct-13 6:58am    
Could you please give me some more information on your second part. (Now in all your wizard step add button. and on click of that button next wizard step should appear. Ask if you need more info regarding this logic.)
Harshil_Raval 24-Oct-13 7:07am    
Check updated reply.
Harshil_Raval 24-Oct-13 8:51am    
Is it works for you?
sathish kumar 24-Oct-13 8:56am    
Sorry, you have mentioned here clearly. but I am struggling because of my less experience in asp.net.
what I am facing is when I use css it also hides my next button invisible, not sure how to figure that out.

Thanks for your reply
Harshil_Raval 24-Oct-13 9:02am    
Then you must have give button class as sidebar. then remove it..Create other class for next button.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900