【发布时间】:2022-01-16 04:49:42
【问题描述】:
在我的 WebForms 应用程序中,我有一个下拉列表 (DDL),其中包含方法 Method_DataBinding 和 Method_DataBound。当我用这个 DDL 打开表单并且它有一些错误的数据时,它给了我一个例外。我想抓住它,但我不明白,在哪里做。
在方法Method_DataBinding 的最后一行没有错误,也没有到达Method_DataBound,所以错误介于这两个方法之间。我不明白在哪里
<asp:DropDownList
ID="SomeId"
runat="server"
DataSourceId="SomeDsId"
OnDataBinding="Method_DataBinding"
OnDataBound="Method_OnDataBound" />
protected void Method_DataBinding()
{
}
// Here betwen this two methods I have error, can't catch it
protected void Method_DataBound()
{
}
【问题讨论】:
-
能否分享一下这些方法的代码以及错误详情?
-
是
SqlDataSource吗?