For more information on the new validation control features in 2.0, refer to Dissecting the Validation Controls in ASP. From here, you can select which template to edit from the drop-down list.
Since we want to augment the editing interface, we need to add validation controls to the (Click to view full-size image) All validation controls work by validating the input of a single ASP. Therefore, we need to indicate that the Required Field Validator we just added should validate against the Text Box in the property value is also the text displayed by the validation control on invalid input.
To add validation controls to the editing and inserting interfaces, the Bound Fields used by the Details View and Grid View controls need to be converted into Template Fields.
To achieve this, click on the Edit Columns and Edit Fields links in the Grid View and Details View's smart tags, respectively.
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).
This summary data can be displayed as text on the web page or through a modal, client-side messagebox.
After setting these three properties of the Required Field Validator, your screen should look similar to Figure 7.
Figure 7: Set the Required Field Validator's After making these changes, open the page in a browser.
To help ensure that a user's inputs are valid, ASP.
NET provides five built-in validation controls that are designed to be used to validate the value of a single input control: For more information on these five controls, check out the Validation Controls section of the ASP. For our tutorial we'll need to use a Required Field Validator in both the Details View and Grid View's Note While ASP.