Gets or sets a value indicating whether the user is allowed to return to the current step from a subsequent step in a WizardStepCollection collection.
Assembly: System.Web (in System.Web.dll)
The property can be used to enforce linear navigation in a Wizard control. If each step has its property set to false, the user will not be able to return to a step after it has been accessed. One scenario where you might use this functionality is to disallow a user to return to a step after it has been completed because you are persisting the data to a database as each step is completed. If you save the data after each step and allow the user to return to a step and change information after it has been saved, the saved data might become corrupted. By setting the property to false, once the user has left a step, he or she will not be able to return to it and change any values.
The property determines how and when the Previous button is not rendered. The following table describes the Previous button rendering behavior.
Linear: Step1 has set to false and user action goes to step 2.
Step 2 does not display the Previous button.
Non-Linear: Step1 has set to false and user action goes to step 3.
Step 3 does not display the Previous button.
SideBar Buttons: Step 2 has set to false , DisplaySideBar is set to true, and a user clicks on the SideBar button.
No buttons are automatically disabled on the sidebar when is set to false. If a user clicks the button, the action is ignored.
Linear & Non-Linear with Custom Template: The step has a custom navigation template.
No automatic hiding or displaying occurs if is set to false when you use a template for navigation. The Previous button should be optional on the template.
Using the Visual Studio Designer and ActiveStepIndex : The control has 5 steps, you are working on step 4, and you run the page.
When step 4 is the ActiveStepIndex, then the Previous button is rendered. The Previous button is only hidden for StepType set to Step when the preceding step in the history has set to false. Since step 4 is rendered first and there are no steps in the history, the Previous button is not hidden.
The wizard control checks to see if the Previous step in the history is the "same" step that the user is currently on. If the step is the same, the wizard control looks back in the history to determine the preceding "different" step and bases the display of the Previous button and destination based on the "different step" in the history.
When the property is set to false, but the DisplaySideBar property of the parent control of WizardStepBase is set to true, clicking on a button in the sidebar area has no effect. The sidebar area is generally displayed to provide nonlinear navigation, so if you are not using the functionality of nonlinear navigation, you may want to set the DisplaySideBar property to false.
The following example demonstrates using the property to stop the user from returning to a step in the Wizard control after it has been accessed. In the example, the Step1 step has its property set to false. After the user leaves the Step1 step, no Previous button appears on the Step2 step.
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>ASP.NET Example</title> </head> <body> <form id="form1" runat="server"> <asp:Wizard id="Wizard1" runat="server" displaysidebar="false" > <WizardSteps> <asp:WizardStep id="WizardStep1" title="Step 1" allowreturn="false" runat="server"> You are currently on Step 1. </asp:WizardStep> <asp:WizardStep id="WizardStep2" title="Step 2" runat="server"> You are currently on Step 2. </asp:WizardStep> <asp:WizardStep id="WizardStep3" title="Step 3" runat="server"> You are currently on Step 3. </asp:WizardStep> </WizardSteps> <HeaderTemplate> <b>WizardStepBase AllowReturn Example</b> </HeaderTemplate> </asp:Wizard> </form> </body> </html>
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.