Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parent's Page_Error event handler
Message
From
14/08/2007 23:34:47
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Parent's Page_Error event handler
Miscellaneous
Thread ID:
01248186
Message ID:
01248186
Views:
65
Hi all,

Initially, I had the following codes in each of my aspx to log the exception into a text file. After I created a parent class with the Page_Error event and changed the aspx to inherit the base page, I found the error line # is not captured whenever the exception occurs (after deployment), but working for debug mode. Kindly advise, thanks.
    ''' <summary>
    ''' Page Error handler
    ''' </summary>
    Protected Sub Page_Error(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Error
        Try
            Dim ex As Exception = Server.GetLastError().GetBaseException
            ErrorLog.GenererateLog(ex.TargetSite.Name, ex.Message, ex.Source, ex.StackTrace, Me.Form.Controls)
            Server.ClearError()
        Catch excpt As Exception

        End Try
        Response.Redirect("Error.aspx")
    End Sub
Next
Reply
Map
View

Click here to load this message in the networking platform