Wrox Programmer Forums
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 27th, 2011, 08:47 AM
Authorized User
Join Date: Aug 2011
Posts: 44
Thanks: 14
Thanked 0 Times in 0 Posts
Default 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 ?

Old August 28th, 2011, 10:02 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

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?


Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 1 page 14 kermit1965 BOOK: Professional ASP.NET MVC 2 6 October 12th, 2010 10:10 AM
Chapter 14 Button click event glevinw BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 6 April 26th, 2010 04:14 PM
chapter 3 page 89: HTTP 500 internal server error igtoroy BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 7 February 23rd, 2010 11:08 AM
Chapter 14 Page 488 - Event handler missing kiwibrit BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 August 13th, 2009 04:18 AM
Lesson on Event Calendar - Chapter 14 Mike Smith BOOK: Professional C#, 2nd and 3rd Editions 6 April 6th, 2004 03:03 PM

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