V
VK
Hello,
I am trying to get the last occured error via the
following code:
Sub Page_Load(...)
Dim zero As Integer = 0
Try
Dim err As Integer = 10 / zero
Catch ex As Exception
End Try
Response.write(Server.GetLastError.Message)
End Sub
However the above code always throws an error at the
response.write line with:
Object reference not set to an instance of an object.
Anybody knows why this is happening?
I am trying to get the last occured error via the
following code:
Sub Page_Load(...)
Dim zero As Integer = 0
Try
Dim err As Integer = 10 / zero
Catch ex As Exception
End Try
Response.write(Server.GetLastError.Message)
End Sub
However the above code always throws an error at the
response.write line with:
Object reference not set to an instance of an object.
Anybody knows why this is happening?