No sorry. But what you can do is write a file when exception occurs. Put this code in global.asax (if you don't have create one). All the exceptions will be propogated here.
Imports System.IO
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when an unhandled error occurs
' Log the error
Dim ex As Exception = Server.GetLastError().GetBaseException()
Dim msg As New StringBuilder()
With msg
.Append("MESSAGE: ")
.AppendLine(ex.Message)
.Append("SOURCE: ")
.AppendLine(ex.Source)
.Append("FROM: ")
.AppendLine(Request.Form.ToString())
.Append("QUERYSTRING: ")
.AppendLine(Request.QueryString().ToString())
.Append("TARGETSITE: ")
.AppendLine(ex.TargetSite.ToString())
.Append("STACKTRACE: ")
.Append(ex.StackTrace)
End With
' Create a text document
Dim path As String = "~/MyError.txt"
Dim sw As StreamWriter
' If it doesn't exist, create it
If File.Exists(Server.MapPath(path)) = False Then
' Create a file to write to.
sw = File.CreateText(path)
sw.Flush()
sw.Close()
End If
' Write it
sw = File.AppendText(path)
sw.WriteLine(msg.ToString())
sw.Flush()
sw.Close()
End Sub
Just give read/write/modify permission to this file, so that the log can be written. After you get the error, check this file for the error message.
codeasp
Star
14735 Points
2545 Posts
Re: Contact me (wizard) form working on local computer but not remotely...
Sep 10, 2007 12:58 AM|LINK
No sorry. But what you can do is write a file when exception occurs. Put this code in global.asax (if you don't have create one). All the exceptions will be propogated here.
Imports System.IO Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) ' Code that runs when an unhandled error occurs ' Log the error Dim ex As Exception = Server.GetLastError().GetBaseException() Dim msg As New StringBuilder() With msg .Append("MESSAGE: ") .AppendLine(ex.Message) .Append("SOURCE: ") .AppendLine(ex.Source) .Append("FROM: ") .AppendLine(Request.Form.ToString()) .Append("QUERYSTRING: ") .AppendLine(Request.QueryString().ToString()) .Append("TARGETSITE: ") .AppendLine(ex.TargetSite.ToString()) .Append("STACKTRACE: ") .Append(ex.StackTrace) End With ' Create a text document Dim path As String = "~/MyError.txt" Dim sw As StreamWriter ' If it doesn't exist, create it If File.Exists(Server.MapPath(path)) = False Then ' Create a file to write to. sw = File.CreateText(path) sw.Flush() sw.Close() End If ' Write it sw = File.AppendText(path) sw.WriteLine(msg.ToString()) sw.Flush() sw.Close() End SubJust give read/write/modify permission to this file, so that the log can be written. After you get the error, check this file for the error message.