Disable the prev button in a wizard

Discussion in 'ASP .Net Web Controls' started by David Thielen, Jan 27, 2007.

  1. David Thielen, Jan 27, 2007
    #1
    1. Advertising

  2. Hi Dave,

    You could control the visibility using CSS:

    <head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
    .hidden { display: none; }
    .visible { display: inline; }
    </style>
    </head>



    protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)
    {
    if (Wizard1.ActiveStepIndex == 1)
    {
    Wizard1.StepPreviousButtonStyle.CssClass = "hidden";
    }
    else
    {
    Wizard1.StepPreviousButtonStyle.CssClass = "visible";
    }
    }


    Hope this helps.


    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Walter Wang [MSFT], Jan 29, 2007
    #2
    1. Advertising

  3. Dave,

    I just realized your question is to disable instead of hide. Since the
    button is not exposed as a public property, you could use your own
    FinishNavigationTemplate and disable the button inside it:

    <FinishNavigationTemplate>
    <asp:Button id="btnPrev" runat="server"
    CommandName="MovePrevious" Enabled="false" Text="Previous" />
    <asp:Button ID="btnFinish" runat="server"
    CommandName="MoveComplete" Text="Finish" />
    </FinishNavigationTemplate>

    You could find these required CommandName in documentation of
    FinishNavigateTemplate.


    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Walter Wang [MSFT], Jan 29, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bogdan
    Replies:
    1
    Views:
    530
    Peter Bucher [MVP]
    May 31, 2008
  2. GaryDean

    Accessing Wizard Next/Prev buttons

    GaryDean, Jun 26, 2008, in forum: ASP .Net
    Replies:
    9
    Views:
    600
    Steven Cheng [MSFT]
    Jul 11, 2008
  3. olivier

    remove prev button in template

    olivier, Apr 28, 2004, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    118
    olivier
    Apr 28, 2004
  4. Mike Lashbrook

    Data Grid Paging Prev button does not fire the PageIndexChanged ev

    Mike Lashbrook, Jul 17, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    134
    Mike Lashbrook
    Jul 17, 2004
  5. David Thielen

    add a link button to prev/next in a wizard

    David Thielen, Sep 12, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    775
    David Thielen
    Oct 1, 2006
Loading...

Share This Page