asp.net ObjectDataSource错误处理 [英] asp.net ObjectDataSource error handling
本文介绍了asp.net ObjectDataSource错误处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都知道如何完成?
页面级错误处理是首选,不会捕获错误感谢,
解决方案
像这样:
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)
{
}
}
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)
{
}
}
这篇关于asp.net ObjectDataSource错误处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文