Onlineatoz.net | ToolBox Standard Control Wizard

ToolBox Standard Control Wizard

Wizard Web Server Control

in ASP.NET environment,This article describes you how to work with Wizard Web Control.The Wizard control allows you to build ASP.NET Web pages that present the user with multi-step procedures.

The ASP.NET Wizard control reducing many of the tasks that are associated with building multiple forms and collecting user input. The Wizard control provides a mechanism that allows you to easily build steps, add a new step, or reorder the steps

Wizard Steps

The Wizard control uses set of steps to defines different sections of user data input. Each step within the control is given a StepType to indicate whether it is the beginning step, intermediate step, or completion step

the following code snippets demonstrates the Wizard steps.

in .aspx page,

<asp:Wizard ID="Wizard1" Runat="server">
    <WizardSteps>
        <asp:WizardStep ID="WizardStep1" Runat="server" Title="Step 1">
        </asp:WizardStep>
        <asp:WizardStep ID="WizardStep2" Runat="server" Title="Step 2">
        </asp:WizardStep>
    </WizardSteps>
</asp:Wizard>
                  
 

Within each step, you can add controls and labels, and accept user data. The Wizard control will help manage which step to display, and help maintain the collected data.

in .aspx.cs page,

protected void txt1_TextChanged(object sender, EventArgs e)
{
   lbl1.Text = Server.HtmlEncode(txt1.Text);
}
 
Wizard Navigation

The Wizard control provides the two features such as linear and non-linear navigation. The control's state management allows the user to move forward and backward between steps, and it allows the user to select individual steps at any point, as long as the sidebar is displayed.

Navigation Buttons

The following elements are used to set the Navigation Text:

  • StepNextButtonText
  • StepPreviousButtonText
  • FinishCompleteButtonText

the following code snippets demonstrates the Wizard Navigations Process.

<asp:Wizard ID="Wizard1" Runat="server"
  StepNextButtonText=" Next >> "
  StepPreviousButtonText=" << Previous "
  FinishCompleteButtonText=" Done! ">
 
Wizard Templates

The Wizard control supports templates that allow you to further customize the interface of the control with the StartNavigationTemplate, FinishNavigationTemplate, StepNavigationTemplate, and SideBarTemplate properties.

 
Creating a Wizard Control

here, By using Wizard control to simplify data collection into a set of independent steps for the User interface data view. You will create a simple wizard that collects a name and Phone number of the user, and then present it back to the user in the completion step. The following steps are needed to achive this:

  • Include a Wizard control to a page.
  • Including a set of controls to the Wizard control
  • Accessing the wizard's data between steps.
To add a Wizard control
  • Go to Design view
  • From the Standard group of the Toolbox, drag a Wizard control onto the page.
To edit the first wizard step
  • Suppose you want to edit, then Enlarge the Wizard control by dragging it as you can possible
  • Click the underlined text Step 1 in the Wizard control.
  • Click the edit area for the Wizard control.
  • Includes the controls in the Wizard
To add a completion step
  • Right-click the Wizard control --> Select Show Smart tag
  • In the Wizard Tasks dialog box, choose Add/Remove Wizard Steps.
  • From the Add drop-down list on the Add button, select Wizard Step.
  • Set the Title property to Finished.
  • Set the StepType property to Complete and Press ok
To show the user's data
  • Switch back to the Page_Load() event
  • Copy and paste the following code in the event
void Page_Load(Object sender, System.EventArgs e)
{
  lbl1.Text = txt1.Text;
  lbl2.Text = txt2.Text;
}
 
To test the Wizard control
  • Simply Run the application by F5
  • Specify the information in step1 and click Next button
  • you can now specify the informtion in step2 and click Next button
  • Click Finsish
 
Related Links

Posted by: Admin
Posted on: 9/13/2011 at 7:40 PM
Categories: Asp.net
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed