October 2010
Intermediate to advanced
1920 pages
73h 55m
English
DeleteButtonFieldI don’t like the Delete button rendered by the GridView control’s CommandField. The problem is that it does not provide you with any warning before you delete a record. In this section, we fix this problem by creating a Delete button that displays a client-side confirmation dialog box (see Figure 11.24).
Figure 11.24. Displaying a confirmation dialog box.

DeleteButtonField inherits from the ButtonField class. The code for the custom field is contained in Listing 11.33.
Listing 11.33. DeleteButtonField.cs

Most of ...