Reputation: 1117
I get an exception at response.redirect() and Visual Studio does not help me with appropriate info. I only get this for ex:expression cannot be evaluated
, message:subprocess annulled
and _HResult:-2146233040
. I don't get a helplink or anything else.
Try
Dim unidadD As String = Request.QueryString("unity")
Dim categD As String = Request.QueryString("category")
Dim resulD As String = Request.QueryString("result")
Dim anioD As String = Request.QueryString("year")
Dim cicloD As String = Request.QueryString("cicle")
Response.Redirect("~/Evaluacion/Detalle_Resultados.aspx?op=1" & "&unity=" & unidadD & "&category=" & categD & "&result=" & resulD & "&cicle=" & cicloD & "&year=" & anioD)
Catch exa As System.Threading.ThreadAbortException
Dim link As String = exa.HelpLink
End Try
Upvotes: 0
Views: 465
Reputation: 161801
Response.Redirect
is expected to throw a ThreadAbortedException
. Simply move the Response.Redirect out of the try/catch block.
Another option is to use:
Response.Redirect(url, False)
This will redirect without ending the current request. You can later call Application.CompleteRequest
.
Another alternative would be
Try
Response.Redirect(url)
Catch tax as ThreadAbortedException
' Do nothing, as this is an expected exception
' No need to rethrow, as this exception is automatically re-thrown
End Try
Upvotes: 1