Home All Groups Group Topic Archive Search About

3 step wizard - ignore last step

Author
23 Oct 2006 4:22 AM
David Thielen
Hi;

I have a 3 step wizard. In some cases when they go from [0] to [1] I know
that I do not want to show page [2] but instead want [1] to be the last page
with the finish button.

What is the best way to implement this?

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

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

Author
23 Oct 2006 8:37 AM
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.
Author
23 Oct 2006 7:20 PM
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




Show quoteHide quote
"Steven Cheng[MSFT]" wrote:

> 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.
>
>
Author
24 Oct 2006 2:21 AM
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.