R
randy.buchholz
I am trying to capture event exceptions using try/catch.
I can get all exceptions with:
protected void dv_PR_ItemInserted(object sender,
DetailsViewInsertedEventArgs e)
{
if (e.Exception != null)
{
lbl_Errors.Text = e.Exception.Message.ToString();
e.ExceptionHandled = true;
}
else
{
Response.Redirect("~/PR/PR_Item.aspx?PR=" + tb_tPR.Text);
}
}
but then have to parse and switch() to get a meaningful message to the user.
Is there a way to use a try/catch in this situation so I can handle the
different exceptions individually?
I can get all exceptions with:
protected void dv_PR_ItemInserted(object sender,
DetailsViewInsertedEventArgs e)
{
if (e.Exception != null)
{
lbl_Errors.Text = e.Exception.Message.ToString();
e.ExceptionHandled = true;
}
else
{
Response.Redirect("~/PR/PR_Item.aspx?PR=" + tb_tPR.Text);
}
}
but then have to parse and switch() to get a meaningful message to the user.
Is there a way to use a try/catch in this situation so I can handle the
different exceptions individually?