• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 888
  • Last Modified:

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

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
AppDevs
Asked:
AppDevs
  • 3
  • 3
1 Solution
 
jorge_torizCommented:
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
 
AppDevsAuthor Commented:
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
 
jorge_torizCommented:
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
Industry Leaders: 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!

 
AppDevsAuthor Commented:
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
 
jorge_torizCommented:
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
 
AppDevsAuthor Commented:
Thanks, I got the PREVIOUS button STEP 1 of the wizard.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now