skip to content »

Referencing detailsview controls after updating

referencing detailsview controls after updating-70

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.In order to provide a customized editing or inserting interface, we need to replace the Bound Field or Check Box Field with a Template Field.

referencing detailsview controls after updating-34referencing detailsview controls after updating-3referencing detailsview controls after updating-39referencing detailsview controls after updating-23

The values of the name/value pairs in the dictionary are derived from child controls.control enables you to perform all these operations without writing Select, Update, Insert, or Delete statements.You will use the Object Relational Designer to create a class that represents the database table that contains the values.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.Likewise, Check Box Fields, which are disabled in the standard, read-only interface, are converted into enabled checkboxes in the editing and inserting interfaces.The format of the parameters for original values is determined by the is created to pass the original value.

You can then include both parameters in an SQL statement to differentiate between the current and original values for the field, as shown in the following example: collections directly.

For example, in an update operation, the data-bound control reads parameter values from .

For an update or delete operation, by default only parameters for current bound values are created.

A common way to use these collections is to HTML-encode the values supplied by the user before they are stored in the data source. For more information about handling events, see NIB: Consuming Events.

dictionary contains the names and values of fields that uniquely identify the record to update or delete, and always contains the original values of the key fields before the record was edited.

Template Fields, which were the topic of discussion in the Using Template Fields in the Grid View Control and Using Template Fields in the Details View Control tutorials, can consist of multiple templates defining separate interfaces for different row states.