|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
3 step wizard - ignore last stepHi;
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 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. 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. -- Show quoteHide quotethanks - dave david_at_windward_dot_net http://www.windwardreports.com Cubicle Wars - http://www.windwardreports.com/film.htm "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. > > 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.
Need button control that...
auto-size textbox Can't duplicate ID in subclassed GridView menu question all bitmap button in grid? how to validate input of a detailsview? Anyone have APP_LocalResources resx files for the MS controls... Datagrid template column GridView RowComand event Issue asp:Repeater and asp:Table |
|||||||||||||||||||||||