I am capturing the unhandled exceptions with the application_error in global.asax. I want to show a label with the error in the aspx which throwed the exception. Is there a way to do this?. Is it possible? I mean changing a label from the global.asax.
diegonet82
Member
9 Points
29 Posts
global.asax change label text
Dec 27, 2012 04:27 PM|LINK
Hi.
I am capturing the unhandled exceptions with the application_error in global.asax. I want to show a label with the error in the aspx which throwed the exception. Is there a way to do this?. Is it possible? I mean changing a label from the global.asax.
Thanks.
SohailShaikh
Contributor
6129 Points
1172 Posts
Re: global.asax change label text
Dec 27, 2012 05:04 PM|LINK
why dont you write Error in the file from global.acsx file
Sohail Shaikh
diegonet82
Member
9 Points
29 Posts
Re: global.asax change label text
Dec 27, 2012 06:09 PM|LINK
Hi.
Because the user requires to show the errors in a label. It is a standard for that web application. show all the errors in a error label.
sameer_khanj...
Contributor
7066 Points
1381 Posts
Re: global.asax change label text
Dec 28, 2012 05:42 AM|LINK
For this you need to handle Error on page level.
http://msdn.microsoft.com/en-us/library/ed577840(v=vs.100).aspx
There are many ways for error handling,
1) Block Level (Try... Catch..Finally) http://msdn.microsoft.com/en-us/library/0yd65esw(v=vs.80).aspx
2) Page Level (Page_Error(object sender, EventArgs e) on every page) http://msdn.microsoft.com/en-us/library/ed577840(v=vs.100).aspx
3)Application Level (application_error in global.asax) http://msdn.microsoft.com/en-us/library/ee797169(v=cs.20).aspx
4) SCript manager level For Ajax http://www.codedigest.com/Articles/ASPNETAJAX/115_Error_Handling_in_ASPNet_Ajax_Applications.aspx
sameer.khanjit@gmail.com
View Blog
Click "Mark as Answer" on the post that helped you.
SohailShaikh
Contributor
6129 Points
1172 Posts
Re: global.asax change label text
Dec 28, 2012 10:01 AM|LINK
Then please use error on page not in global file
Sohail Shaikh
oned_gk
All-Star
31782 Points
6496 Posts
Re: global.asax change label text
Dec 28, 2012 11:25 AM|LINK