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(ByVa l sender As Object, ByVal e As EventArgs)
Dim ex As Exception = Server.GetLastE rror()
Response.Write( "Handled error from Page")
End Sub
Sub Application_Err or(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when an unhandled error occurs
Dim ex As Exception = Server.GetLastE rror()
Response.Write( "Handled error from Application ")
Server.ClearErr or()
End Sub
Sub Global_Error(By Val sender As Object, ByVal e As EventArgs)
Dim ex As Exception = Server.GetLastE rror()
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
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(ByVa l sender As Object, ByVal e As EventArgs)
Dim ex As Exception = Server.GetLastE rror()
Response.Write( "Handled error from Page")
End Sub
Sub Application_Err or(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when an unhandled error occurs
Dim ex As Exception = Server.GetLastE rror()
Response.Write( "Handled error from Application ")
Server.ClearErr or()
End Sub
Sub Global_Error(By Val sender As Object, ByVal e As EventArgs)
Dim ex As Exception = Server.GetLastE rror()
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
Comment