Solved

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

Posted on 2011-02-14
6
867 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do sunrise and sunset times change with altitude 14 38
Add or delete table rows 10 54
IEnumerable<T> to a List<T> 8 40
Groupbox Control ? 2 19
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 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