title: ASP.NET - How to wrap GridView Delete in try catch or stop a row delete
body: <p>I want to be able to wrap a gridview row delete in a try catch and display a nice error message on the screen or try to stop the delete from happening in certain circumstances.</p>
  
  <p>At the moment, I am getting foreign key violations in the database.   So I either want to stop the delete from happening if there are child records or catch the foreign key exception and display a nice error message to the screen.</p>
  
  <p>Can anyone tell me how to do this?</p>