开发者

asp.net ObjectDataSource error handling

开发者 https://www.devze.com 2023-01-11 16:26 出处:网络
I have objectdatasource and I am trying to find a way to capture the error that is thrown by the SELECT method.

I have objectdatasource and I am trying to find a way to capture the error that is thrown by the SELECT method.

anyone idea how it can be done?

Page level error 开发者_开发问答handling is preferred, not capturing error at the application_error in global.asax

thanks,


Like this:

protected void Page_Load(object sender, EventArgs e)
    {           
        ds.Selected += new ObjectDataSourceStatusEventHandler(ds_Selected);
    }

    void ds_Selected(object sender, ObjectDataSourceStatusEventArgs e)
    {
        if (e.Exception != null)
        {

        }
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号