3

I have a datasource that uses a business logic object for the select event. How can I catch an exception that occurs in the business logic layer and pass it to my presentation layer to display to the user in a label?

1 Answer 1

3

You can catch datasource exceptions like this:

protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)
{
    if (e.Exception != null)
    {
        // do something
        e.ExceptionHandled = true;
    }
}
Sign up to request clarification or add additional context in comments.

1 Comment

Man...I was so close! I was just missing the "e.ExceptionHandled = true;" piece! Thanks for your quick reply.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.