Error handling

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rpradeepa
    New Member
    • Apr 2008
    • 23

    Error handling

    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
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

    Please refer this Link to see how to do custom error handling using ASP .Net web.config file.

    Comment

    • rpradeepa
      New Member
      • Apr 2008
      • 23

      #3
      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

      Comment

      Working...