-----------------------------------------------------------

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: Swapnil_B1
Message 1 in Discussion

  
The Wizard Control in ASP.NET 2.0  
The ASP.NET Wizard control simplifies many of the tasks associated with 
building a series of forms to collect user data. The control provides a 
mechanism that allows you to easily build the desired wizard as a collection of 
steps, add a new step, or reorder the steps. You don't have to write any 
infrastructure whatsoever for navigation or to persist user data between steps. 
 
Using the Wizard Control  
A Wizard control is made up of four main parts: header, view of the current 
step, navigation bar, and sidebar. All of these constituent parts, and much 
more, can be styled using a number of properties. The contents of the header, 
sidebar, and navigation bar can be further customized through the templates.  
To use the Wizard control—the <asp:Wizard> element—you follow these simple 
steps: drop a Wizard control onto your Web Forms, add constituent controls, 
images, and text to each wizard step, and access the wizard's data between 
steps.  
The Wizard control is a composite control that inherits from the 
CompositeControl base class and gets integrated designer support from Visual 
Studio 2005. It posts back to itself to maintain view state information. This 
fact alone allows for nonlinear navigation and guarantees that form elements 
are automatically repopulated across multiple views of the wizard procedure.  
Each step in a wizard is a sort of panel—a container of text, markup, images, 
and custom user controls.  
Adding Steps to a Wizard  
The <WizardSteps> block gathers all the defined steps in which the wizard 
procedure is articulated. The WizardSteps collection can be edited visually 
through the property dialog. You can add two types of steps to the collection—a 
simple wizard step or a templated wizard step. In the former case, you add a 
WizardStep control; in the latter case, an instance of the TemplatedWizardStep 
control is added to the page. The two-step controls work in a similar manner 
and accept a collection of server controls defined explicitly.  
 <asp:wizardstep runat="server" steptype="auto" title="One step">  
    <div>  
      <!-- any controls go here -->  
    </div>  
</asp:wizardstep>  
The contents of a WizardStep can be dynamically adjusted and steps can be 
programmatically added or removed as you please. However, to allow for further 
customization, TemplatedWizardStep can be used instead of WizardStep, allowing 
users to change the content and navigation templates within it. By default, you 
can only have three different navigation templates: start, step, and finish. 
Using TemplatedWizardStep allows you to have different navigation buttons on 
each of the steps.  
Here's how you define a templated step:  
<asp:TemplatedWizardStep runat="server" steptype="auto">  
  <ContentTemplate>  
      <!-- any UI goes here -->  
  </ContentTemplate>  
</asp:TemplatedWizardStep>  
The <ContentTemplate> element corresponds to an instance of an object that 
implements the ITemplate interface. This object gets or sets the template for 
displaying the content of a page in the Wizard. It goes without saying that you 
can define or change the template programmatically. In addition, a templated 
wizard step control lets you modify the navigation bar through a template:  
<asp:TemplatedWizardStep runat="server" steptype="auto">  
  <ContentTemplate>  
      <!-- any UI goes here -->  
  </ContentTemplate>  
  <CustomNavigationTemplate>  
      <asp:Button Runat=Server Text="My Button" />  
  </CustomNavigationTemplate>  
</asp:TemplatedWizardStep>  
By adding a <CustomNavigationTemplate> block you can take full control of the 
navigation usually displayed at the bottom of the current view. You normally 
fill the <CustomNavigationTemplate> block with a series of buttons, but other 
controls are acceptable as well, with the restriction that those controls must 
support command bubbling, as does Button.  
A wizard step is just one of the forms in which you break up the original user 
interface to build the wizard. So a wizard step will typically contain input 
controls such as text and checkboxes, dropdown lists, calendars, validators, 
and whatever else you can use to collect data from users.  
All step classes inherit from the WizardStepBase class. The base class provides 
each child class with a property named StepType. The property gets or sets the 
type of navigation buttons to display for a page in a Wizard control. By 
default, the type of a step is dynamically determined by the control. The first 
step is a Start step, and the last is the Finish step; unless specified by the 
user, the control doesn't automatically assign steps to be Complete steps. All 
other intermediate steps are ordinary steps. The main difference between the 
step types is in the list of buttons displayed in the navigation area. An 
ordinary step allows a user to move back and forth, whereas a Start step 
doesn't display a Back button, and a complete step doesn't provide any 
navigation whatsoever. As mentioned, all these built-in rules can be altered if 
you use a templated solution.  
Swapnil (Swaps)  
http://swapsnet.spaces.live.com/ 

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/MumbaiUserGroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to