Solved

How to add PREVIOUS button on STEP1 of ASP.Net wizard?

Posted on 2011-02-14
6
864 Views
Last Modified: 2012-05-11
I want to add previous button on step 1 of ASP.Net wizard? How can I add it.
It should next to NEXT and PREVIOUS buttons.
cancel-button.bmp
0
Comment
Question by:AppDevs
  • 3
  • 3
6 Comments
 
LVL 15

Expert Comment

by:jorge_toriz
ID: 34893047
With custom navigation templates:

ASP .NET:

<asp:Wizard ID="testWizard" runat="server" ActiveStepIndex="0" OnPreviousButtonClick="testWizard_PreviousButtonClick">
    <WizardSteps>
        <asp:TemplatedWizardStep ID="twsFirst" runat="server">
            <ContentTemplate>
                This is the first step
            </ContentTemplate>
            <CustomNavigationTemplate>
                <asp:Button ID="cmdPrevious" runat="server" CommandName="MovePrevious" Text="My previous button" />
                <asp:Button ID="cmdNext" runat="server" CommandName="MoveNext" Text="My next button" />
            </CustomNavigationTemplate>
        </asp:TemplatedWizardStep>
        <asp:TemplatedWizardStep ID="twsSecond" runat="server">
            <ContentTemplate>
                This is the second step
            </ContentTemplate>
            <CustomNavigationTemplate>
                <asp:Button ID="cmdPrevious" runat="server" CommandName="MovePrevious" Text="My previous button" />
                <asp:Button ID="cmdNext" runat="server" CommandName="MoveNext" Text="My next button" />
            </CustomNavigationTemplate>
        </asp:TemplatedWizardStep>
        <asp:TemplatedWizardStep ID="twsThird" runat="server">
            <ContentTemplate>
                This is the third step
            </ContentTemplate>
            <CustomNavigationTemplate>
                <asp:Button ID="cmdPrevious" runat="server" CommandName="MovePrevious" Text="My previous button" />
                <asp:Button ID="cmdNext" runat="server" CommandName="MoveComplete" Text="My finish button" />
            </CustomNavigationTemplate>
        </asp:TemplatedWizardStep>
    </WizardSteps>
</asp:Wizard>

C#:

protected void testWizard_PreviousButtonClick(object sender, WizardNavigationEventArgs e)
{
    if (e.CurrentStepIndex == 0)
        Response.Output.Write("You clicked previous on first wizard step");
}
0
 

Author Comment

by:AppDevs
ID: 34907178
I am using  <asp:WizardStep runat="server"> tags.
I am using <table> tags in my design, so I would like to keep  <asp:WizardStep> tags
<CustomNavigationTemplate> tag is not recognized by <asp:WizardStep> tag.
Is there any other way to add the PREVIOUS button to the wizard template.
0
 
LVL 15

Expert Comment

by:jorge_toriz
ID: 34907824
Use the property StepType of your first WizardStep:

<asp:Wizard ID="wTest" runat="server" ActiveStepIndex="0">
    <WizardSteps>
        <asp:WizardStep Title="First step" StepType="Step" ID="wsFirst" runat="server">
            This is the first step
        </asp:WizardStep>
        <asp:WizardStep Title="Second step" ID="wsSecond" runat="server">
            This is the second step
        </asp:WizardStep>
        <asp:WizardStep Title="Third step" ID="wsThird" runat="server">
            This is the third step
        </asp:WizardStep>
    </WizardSteps>
</asp:Wizard>
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:AppDevs
ID: 34909840
I apologize for not posting the whole tag I am useing
<asp:WizardStep runat="server" title="Step 1" StepType="Start">
I already have StepType.
0
 
LVL 15

Accepted Solution

by:
jorge_toriz earned 500 total points
ID: 34910041
Well, if you want to show the previous button you must change the step type to "Step"... or, can't you do that change?
0
 

Author Closing Comment

by:AppDevs
ID: 34915556
Thanks, I got the PREVIOUS button STEP 1 of the wizard.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

863 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

22 Experts available now in Live!

Get 1:1 Help Now