Skip to Content
ASP.NET 4 Unleashed
book

ASP.NET 4 Unleashed

by Stephen Walther, Kevin Hoffman, Nate Dudek
October 2010
Intermediate to advanced
1920 pages
73h 55m
English
Sams
Content preview from ASP.NET 4 Unleashed

Deleting Data with the DetailsView Control

You can delete records with the DetailsView control by enabling its AutoGenerateDelete Button property. The page in Listing 12.16 enables you to both insert and delete records in the Movies database table.

Listing 12.16. ShowDelete.aspx

images

images

When deleting records, you need to supply a value for the DetailsView control’s DataKeyNames property. A parameter named @Id represents the value of the ID column in the DeleteCommand property.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET 3.5 Unleashed

ASP.NET 3.5 Unleashed

Stephen Walther
ASP.NET 4.0 in Practice

ASP.NET 4.0 in Practice

Marco De Sanctis, Daniele Bochicchio, Stefano Mostarda

Publisher Resources

ISBN: 9780132565851Purchase book