Conclusion : validations and new available controls

In this tutorial, we looked at both the ASP.NET validations and several of the new controls available in ASP.NET 2.0. ASP.NET has always strived to lessen the drudgery of Web development by solving the most common use cases encountered during the development of Web sites.

Whenever you sign onto a commercial Web site, you almost invariably hit a form that asks you for information. When creating such forms, you will want to ensure that the data coming from the user is as accurate as possible. It's a good idea to check certain things, such as making sure all the required fields are filled, the fields have data in the correct format, and that certain data matches specific values or falls within a stated range. ASP.NET validators perform this function.

The ASP.NET TreeView helps users browse hierarchical data structures (such as directories). The TreeView renders expandable and collapsible nodes that let users drill down into the data structures. The MultiView and the View work very much like panels that can be swapped in and out.

Next up: Web Parts (server-side controls on steroids).

Tutorial 6 Quick Reference

How to validate Form input

  1. ASP.NET includes a number of validator controls that check data entered via server-side controls. These controls include

    • CompareValidator

    • RangeValidator

    • RequiredFieldValidator

    • RegularExpressionValidator

    • ValidationSummary

    • CustomValidator

  2. To validate the input of a server-side control, drag the appropriate validator control onto the page and set the ControlToValidate property to the target control

  3. Set the other validator properties appropriately

  4. Instantiate the child control

  5. Add the child control to the composite control's Control collection

How to Display hierarchical data sets in an intuitive way

  1. Use the TreeView control

  2. Either add items by hand, or bind the TreeView control to a hierarchical data source

How to Swap between several pages of information on the same Web page

  1. Use the MultiView and View controls

  2. You can think of the View control as a miniature page managing controls

  3. The MultiView manages a collection of Views

  4. The MultiView supports swapping between Views