Wizard SideBarButtonClick

  • Thread starter Thread starter GaryDean
  • Start date Start date
G

GaryDean

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?
 
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>
 
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:
(e-mail address removed).

==================================================
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" <[email protected]>
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?
 
Back
Top