A
Alex Nitulescu
Hi.
I read about Page_Error and Application_Error. However, I provoke an error
in a page but still Page_Error won't run. This is all the code I have left
in my page:
---------------------------------------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim txtTextBox As TextBox
txtTextBox.Text = "A"
End Sub
Sub Page_Error(ByVal sender As Object, ByVal e As EventArgs)
Response.Write("Error: ")
Response.Write("<p></p>")
Response.Write(Server.GetLastError.Message)
Server.ClearError()
End Sub
---------------------------------------------------------------------------------
I see "Object reference not set to an instance of an object" in the default
ASP.NET error page....
I have played with Debug=true/false, trace=True/False, <customErrors
mode="On/Off/RemoteOnly" />, etc, but to no avail.
Please, what am I missing here ?
Thank you, Alex.
I read about Page_Error and Application_Error. However, I provoke an error
in a page but still Page_Error won't run. This is all the code I have left
in my page:
---------------------------------------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim txtTextBox As TextBox
txtTextBox.Text = "A"
End Sub
Sub Page_Error(ByVal sender As Object, ByVal e As EventArgs)
Response.Write("Error: ")
Response.Write("<p></p>")
Response.Write(Server.GetLastError.Message)
Server.ClearError()
End Sub
---------------------------------------------------------------------------------
I see "Object reference not set to an instance of an object" in the default
ASP.NET error page....
I have played with Debug=true/false, trace=True/False, <customErrors
mode="On/Off/RemoteOnly" />, etc, but to no avail.
Please, what am I missing here ?
Thank you, Alex.