Connecting Tech Pros Worldwide Help | Site Map

Error handling

Newbie
 
Join Date: Apr 2008
Posts: 23
#1: Jul 24 '08
Hi,

For handling the errors globally, i did some thing in web configuration file and global.asax file

In web configuration
<customErrors mode="Off" defaultRedirect="Err.htm"></customErrors>

In global.asax

Sub Page_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim ex As Exception = Server.GetLastError()
Response.Write("Handled error from Page")
End Sub

Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when an unhandled error occurs
Dim ex As Exception = Server.GetLastError()
Response.Write("Handled error from Application ")
Server.ClearError()
End Sub

Sub Global_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim ex As Exception = Server.GetLastError()
Response.Write("Handled error from Global ")
End Sub

but itz not working ,I dont know how to do that plz guide me

How to do global error handling in asp.net
shweta123's Avatar
Expert
 
Join Date: Nov 2006
Location: India,Pune
Posts: 686
#2: Jul 24 '08

re: Error handling


Hi,

Please refer this Link to see how to do custom error handling using ASP .Net web.config file.
Newbie
 
Join Date: Apr 2008
Posts: 23
#3: Jul 25 '08

re: Error handling


Hi

Thanks for the reply

I want to handle the errors globally in the application, dont want to redirect the page

plz give some other solution
Reply