Figure 1: The Previous Example Allows Users to Add New Products and Edit Existing Ones (Click to view full-size image) Our goal for this tutorial is to augment the Details View and Grid View to provide validation controls.In particular, our validation logic will: in action).The following markup shows the declarative syntax for the By clicking the "Convert this field into a Template Field," Visual Studio has created a Template Field whose templates mimic the user interface of the converted Bound Field.You can verify this by visiting this page through a browser.Similarly, when inserting a new record into a Details View control, those Bound Fields whose (the default) are rendered as empty textboxes, into which the user can provide the new record's field values.
NET 2.0 has added a number of improvements, the main two being client-side script support for browsers other than Internet Explorer and the ability to partition validation controls on a page into validation groups. To accomplish this, click on the Edit Templates link from the Grid View's smart tag to bring up the template editing interface.
Additionally, the page included a Details View whose , thereby always rendering in insert mode.
From this Details View, the user could enter the name and price for a new product, click Insert, and have it added to the system (see Figure 1).
You'll find that the appearance and behavior of the Template Fields is identical to the experience when Bound Fields were used instead.
When constructing data entry forms, it is important that users enter any required fields and that all provided inputs are legal, properly-formatted values.
While this exception can be gracefully handled as demonstrated in the previous tutorial, ideally the editing or inserting user interface would include validation controls to prevent a user from entering such invalid data in the first place.