p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 (http://p2p.wrox.com/forumdisplay.php?f=389)
-   -   Chapter 14, page 500, Deleted event (http://p2p.wrox.com/showthread.php?t=84876)

Antonius Block August 27th, 2011 08:47 AM

Chapter 14, page 500, Deleted event
Hi, Imaar

In a "Try It Out" of chapter 14 (Presenting data - Advanced topics), on page 499-500 you set up an event handler for the Deleted event of a SqlDataSource in order to catch a foreign-key exception.
That's OK.

Could I use the RowDeleted event of the GridView to get the same result ?

In other words, what is the difference between DataSource and DataBound controls' events ?


Imar August 28th, 2011 10:02 AM

The event on the data source fires before the one on the data control so I think that unless you explicitly decide not to handle the exception in the event on the data source, this won't work as the code has crashed before it reaches the data control. But it would be easy to try out and see how it works.

Why would you want to handle this on the data control instead?



All times are GMT -4. The time now is 10:08 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.