Datasheet

<asp:LoginView>: Provides various login views depending on the selected template
<asp:PasswordRecovery>: Provides the web site administrators with the capability to email
the users their lost password
The login controls described here abstract most of the common tasks for which developers have to man-
ually write code for a secured web site. Although this could be achieved in ASP.NET 1.x, you still had to
add controls manually and write code. Apart from providing the user interface, ASP.NET 2.0 also pro-
vides the capability to retrieve and validate user information using Membership functionality. To this
end, ASP.NET ships with a new Membership API, the aim of which is to abstract the required member-
ship functionality from the storage of the member information.
Other New Controls
In addition to the new controls, ASP.NET 2.0 also provides numerous enhancements to existing controls
that make these controls more versatile than ever before in building component-based web pages. For
example, the
Panel control now has a DefaultButton property that specifies which button should be
clicked if the user presses the Enter key while the panel has the focus.
There is also a new
Wizard control, which simplifies the task of building web UIs that step users
through sequential operations. Individual steps are defined by
WizardStep controls. The Wizard con-
trol serves as a container for
WizardStep and provides a default interface for stepping backward and
forward. It is also capable of displaying a list of steps, enabling users to randomly navigate between
them, and it fires events that can be used to programmatically control step ordering. A simple
Wizard
control declaration is:
<asp:Wizard ID=”Wizard1” runat=”server”>
<WizardSteps>
<asp:WizardStep ID=”WizardStep1” runat=”server” Title=”Step 1”>
Wizard Step 1
</asp:WizardStep>
<asp:WizardStep ID=”WizardStep2” runat=”server” Title=”Step 2”
StepType=”Complete”>
Wizard Step 2
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
Another interesting and potentially very useful control debuting in ASP.NET 2.0 is the MultiView con-
trol. Paired with
View controls, MultiView controls can be used to create pages containing multiple logi-
cal views. Only one view (the one whose index is assigned to the
MultiView control’s ActiveViewIndex
property) is displayed at a time, but you can switch views by changing the active view index.
Validation Groups
In ASP.NET 1.x, you would assign validation controls to input controls such as text boxes, password
fields, radio buttons, and check boxes, and the validation controls would automatically validate the data
entered by an end user to input controls. With ASP.NET 2.0, Microsoft introduces a new feature known
as validation groups, which enables you to create different groups of validation controls and assign
them to input controls, such as text boxes. You can assign a validation group to a collection of input con-
trols if you want to validate the collection of input controls on the same criteria. For example, you can
assign the button control to a group of input controls and validate the data entered to each group of
input controls on a criterion. This feature is very handy when you have multiple forms on a single web
11
Chapter 1: Introduction to ASP.NET 2.0
05_041796 ch01.qxp 12/29/06 9:09 PM Page 11