Article

Beginning ASP.NET Using VB.NET - Chapter 14: ASP.NET Server Controls

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Next

Control Families

ASP.NET server controls can be grouped into four basic family types: Intrinsic, Validation, Rich, and Data Rendering controls. These control families are fairly broad and are based primarily on the function or purpose of the control.

When designing a web form, you'll often need to ask yourself two questions: "What do I need to display?" and "How am I going to display it?". Once you're familiar with the various controls and what they do, it's relatively easy to know which ASP.NET server controls you'll need to get the job done. When you create ASP.NET pages, you are free to mix and match all kinds of different controls within your pages, including standard HTML controls.

Intrinsic Controls

These are controls that correspond directly to HTML commands, such as Button, Checkbox, DropDownList and TextBox. We are familiar with these controls now, as we've been using them throughout the book, so we won't spend any more time explaining how they all work, but here is a list to remind you of which controls fall into this group:

awroxtbl23.png

Validation Controls

The worth of any given web form could be measured by the accuracy of the data it was designed to collect. If the data is bogus, with values that are missing, out of range, or simply meaningless, your clients will probably complain pretty quick!

To help alleviate the problem of invalid data entry, and to ease some of the development burden, Microsoft has provided a family of ASP.NET server controls that specialize in validating input and, if necessary, provide feedback to the user.

Validation controls are good examples of how ASP.NET server controls, in general, serve to abstract common tasks that would typically involve manual client-side validation scripting. By using ASP.NET validation controls within ASP.NET web forms, developers are relieved of the work of writing custom client-side validation for their web pages. Validating a user's data entry is important in a variety of scenarios. For example, if we wrote a logon form that collects a user's name and password, we would want to validate that these fields were entered before passing the data on to the server.

We've already seen some validation controls in action in travel.aspx, so we won't spend long looking at them here. Just take a look through the list of controls below, to get an idea of what is possible:

awroxtbl24a.png

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links