views:

8

answers:

0

I have a gridview in a page, linked to an objectdatasource that is linked to a function in a BLL.

the gridview delete query links to a delete method in the BLL class. When something goes wrong, I throw a new exception in the BLL class.

Now to catch this exception if anything goes wrong, I have written the following behind the gridview RowDeleted() event:

Protected Sub GridView1_RowDeleted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeletedEventArgs) Handles GridView1.RowDeleted
        lblStatus.Text = e.Exception.InnerException.Message
        e.ExceptionHandled = True
    End Sub

This keeps giving me "exception was unhandled by user" when I try to delete a user from the grid and in the BLL the exception is thrown correctly ...

Does anyone know how to solve this. I think this stopped working since Visual studio asked me to upgrade the project to 4.0 but I'm not sure.