Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parent's Page_Error event handler
Message
De
14/08/2007 23:34:47
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Parent's Page_Error event handler
Divers
Thread ID:
01248186
Message ID:
01248186
Vues:
67
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform