Wizard SideBarButtonClick

Discussion in 'ASP .Net' started by GaryDean, Jun 15, 2008.

  1. GaryDean

    GaryDean Guest

    In this event I can tell where I'm going via e.NextStepIndex but how can I
    tell where I am coming from? Do I have to setup Session["whereamI"] and
    track it myself?

    --
    Regards,
    Gary
     
    GaryDean, Jun 15, 2008
    #1
    1. Advertising

  2. Hello GaryDean,

    use the session or url string for this

    ---
    WBR,
    Michael Nemtsev [Microsoft MVP] :: blog: http://spaces.live.com/laflour

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo


    G> In this event I can tell where I'm going via e.NextStepIndex but how
    G> can I tell where I am coming from? Do I have to setup
    G> Session["whereamI"] and track it myself?
    G>
     
    Michael Nemtsev [MVP], Jun 16, 2008
    #2
    1. Advertising

  3. Hi Gary,

    As for the Wizard control, it only store the current ActiveStep's Index
    internally. And in the "SideBarButtonClick" event, it will provide the
    currentIndex as one parameter and the target stepindex(the one user has
    clicked) as next step index. If you need the further previous step index,
    you need to manually persist it. One good place to store it is using
    ViewState. And here you can simply use Wizard control's Attributes
    collection to store it(that will be automatically persisted into
    viewstate).

    Here is a simple code snippet I've tried on this.
    =====================
    protected void Wizard1_SideBarButtonClick(object sender,
    WizardNavigationEventArgs e)
    {
    string prev = Wizard1.Attributes["previous_step"];

    Response.Write(
    string.Format("<br/>originally come from step{0} to step{1}"
    , prev, e.CurrentStepIndex)
    );

    Response.Write(
    string.Format("<br/>will go from step{0} to step{1}"
    , e.CurrentStepIndex, e.NextStepIndex)
    );


    Wizard1.Attributes["previous_step"] = e.CurrentStepIndex.ToString();
    }
    ==========================

    Hope this helps.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.
    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.


    --------------------
    >From: "GaryDean" <>
    >Subject: Wizard SideBarButtonClick
    >Date: Sun, 15 Jun 2008 11:16:09 -0700


    >In this event I can tell where I'm going via e.NextStepIndex but how can I
    >tell where I am coming from? Do I have to setup Session["whereamI"] and
    >track it myself?
    >
    >--
    >Regards,
    >Gary
    >
    >
    >
     
    Steven Cheng [MSFT], Jun 16, 2008
    #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. Bill Smarty
    Replies:
    0
    Views:
    518
    Bill Smarty
    Jan 13, 2004
  2. eazycode

    VB.NET Forms Wizard

    eazycode, Apr 18, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,073
    eazycode
    Apr 18, 2004
  3. HS

    Upgrade Wizard - Problem

    HS, May 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    500
  4. Replies:
    0
    Views:
    643
  5. Andy B
    Replies:
    0
    Views:
    466
    Andy B
    Apr 19, 2008
Loading...

Share This Page