G
Guest
Hello,
I would like to show an error message in a user control when an exception is
thrown.
This message should be built in Page_error or Application_error event and i
don't manage to reach a label contained in a user control from these events :
"lbl_error" is the ID of my label :
private void Page_Error(object sender, System.EventArgs e)
{
Exception objErr = Server.GetLastError().GetBaseException();
string error =
(((System.Web.UI.Page)sender).Controls[1].FindControl("lbl_error")).ID ;
Server.ClearError();
}
Any idea ?
Thanks,
I would like to show an error message in a user control when an exception is
thrown.
This message should be built in Page_error or Application_error event and i
don't manage to reach a label contained in a user control from these events :
"lbl_error" is the ID of my label :
private void Page_Error(object sender, System.EventArgs e)
{
Exception objErr = Server.GetLastError().GetBaseException();
string error =
(((System.Web.UI.Page)sender).Controls[1].FindControl("lbl_error")).ID ;
Server.ClearError();
}
Any idea ?
Thanks,