Asp detailsview itemupdating

12 May

To cancel the update operation, set the collections, if necessary, before the values are passed to the data source.

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.

The Details View control can be bound to a data source control (such as the Sql Data Source control or Object Data Source control) or to any data source collection that implements the IEnumerable interface, such as Data View, Array List, List`1, or other collection types.

This allows you to provide an event handler that performs a custom routine, such as canceling the update operation, whenever this event occurs.

A Details View Update Event Args object is passed to the event handler, which allows you to determine the index of the record being updated and to indicate that the update operation should be canceled.

For example ‘@Parameter’, will be sent in the update to the record instead of null.

To solve this, you would need to automatically detect whether a value is null and then add it to the Update Parameters list.