Murray Brown
asked on
ASP.net Code error trapping not working
Hi
In my ASP.net web app the following code is causing an error that for some reason the error handling
code is not trapping. Also the rest of the code doesn't in the procedure does not run
In my ASP.net web app the following code is causing an error that for some reason the error handling
code is not trapping. Also the rest of the code doesn't in the procedure does not run
Try
Session("oMessageToEmail") = xSellerUsername
Catch ex As Exception
Response.Write(ex.Message)
End Try
I don't know if I will be able to help but what is the exception that is being thrown?
ASKER
It isn't throwing an exception. That is what is baffling me. The code just stops before Catch ex As Exception
Don't know why assigning a value to Session("oMessageToEmail") would cause it to stop running. So when you say this, "The code just stops before Catch ex As Exception", where is the yellow instruction pointer pointing to, which line?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
As a test I ran the following code and the code did not get to the last line "Dim y as String = x"
Dim x As String
Try
Session("oMessageToEmail") = xSellerUsername
Catch ex As Exception
x = ex.Message
End Try
Dim y As String = x
ASKER
I was in release mode. Thanks for the help
Not a problem Murray, glad to help.