3 step wizard - ignore last step

S

Steven Cheng[MSFT]

Hello Dave,

From your description, you want to let your wizard control dynamically
determine which page should be the last page and stop further navigation,
correct?

Based on my research, the ASP.NET wizard control provide the
"ActiveStepChanged" and "NextButtonClick" events. So you can add some code
logic in these events to determine whether you should got to the next tab
or cancel the navigation or directly go to hte final finish step.

For your scenario, I suggest you create a dedicated finish step and all the
other former steps can directly go to it when the operation should be
finished. Then, you can add code logic in "NextButtonClick" event and
determine whether we should directly let the wizard control to to the final
finish step. e.g.

===============================
protected void Wizard1_NextButtonClick(object sender,
WizardNavigationEventArgs e)
{
if (e.CurrentStepIndex == 1)
{
if (txtStep2.Text == "finish")
{

Wizard1.MoveTo(Wizard1.WizardSteps[3]);
}
}
}

======================================

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

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.
 
D

David Thielen

Hi;

To resolve this is in OnNextButtonClick I check and if I just want pages 0 &
1 I set page 1 to WizardStepType.Finish and in the OnFinishButtonClick I
added:
if (validate())
{
wnea.Cancel = true;
return;
}

The is in the finish handler is key because otherwise on an error it will
still go to the next page.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
S

Steven Cheng[MSFT]

Hi Dave,

Yes, according to your code logic an steps' structure, you can use either
the nextButtonClick or FinishButtonClick to do the step swiching logic. So
far what we can utilize to control the workflow of wizard control are just
these events.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top