Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

Andy Morris

@Andy Morris
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Error page not showing
    A Andy Morris

    I have an error page set up and when an error occurs the page is not shown. From my webconfig file:

    From my Global aspx file:

    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
    ' Code that runs when an unhandled error occurs
    ' gets the error occured
    Dim ex As Exception = Server.GetLastError().GetBaseException()
    Try
    ' checks if the event source is registered
    If Not System.Diagnostics.EventLog.SourceExists(".NET Runtime") Then
    System.Diagnostics.EventLog.CreateEventSource(".NET Runtime", "Application")
    End If

        'log the details of the error occured
        Dim log As New System.Diagnostics.EventLog()
        log.Source = ".NET Runtime"
        log.WriteEntry(\[String\].Format(vbCr & vbLf & vbCr & vbLf & "Application Error" & vbCr & vbLf & vbCr & vbLf + "MESSAGE: {0}" &
                                       vbCr & vbLf + "SOURCE: {1}" & vbCr & vbLf + "FORM: {2}" & vbCr & vbLf + "QUERYSTRING: {3}" &
                                       vbCr & vbLf + "TARGETSITE: {4}" & vbCr & vbLf + "STACKTRACE: {5}" & vbCr
                                       & vbLf, ex.Message, ex.Source, Request.Form.ToString(), Request.QueryString.ToString(), ex.TargetSite, \_
         ex.StackTrace), System.Diagnostics.EventLogEntryType.\[Error\])
    
        Server.ClearError()
    Catch
        ' in case of exception occured in log
        Server.ClearError()
    End Try
    Server.ClearError()
    Response.Redirect(String.Format("Error.aspx?aspxerrorpath={0}", Request.Url.PathAndQuery))
    

    End Sub

    What I end up seeing is the master page and the URL shows / Error.aspx, but the error page is not shown with it.

    ASP.NET csharp sysadmin help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups