Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
Try
If Check() Then
Dim pobjLoginInfo = New clsLoginInfo(Trim(txtTenpoID.Text), Trim(txtTantoCd.Text), Request.ServerVariables("REMOTE_ADDR"))
Session("LoginInfo") = pobjLoginInfo
'log输出
clsLogger.gsAddLog(pobjLoginInfo, 1, pstrScreenNm, pstrScreenId, 0, 0, clsMessage.GetMessage("D91000072", txtTantoCd.Text.Trim), "") Response.Redirect(Request.ApplicationPath & "/Main.aspx")
End If
Catch ex As SqlException
lblBtm.Text = rensetu() + clsMessage.GetMessage("E90000001") & Chr(10) & ex.ToString
Catch exc As Exception
lblBtm.Text = rensetu() + clsMessage.GetMessage("E90000001") & Chr(10) & exc.ToString
End Try
End Sub
----------------------------------
上面的代码但是页面跳转情况很正常。到了"/Main.aspx“。
但是单步跟踪的话,会发现代码总会到Catch exc As Exception,
exc是theadabortexception类型,
问题好像是出在Response.Redirect,好像是cache问题?怎么解决这个问题???
Try
If Check() Then
Dim pobjLoginInfo = New clsLoginInfo(Trim(txtTenpoID.Text), Trim(txtTantoCd.Text), Request.ServerVariables("REMOTE_ADDR"))
Session("LoginInfo") = pobjLoginInfo
'log输出
clsLogger.gsAddLog(pobjLoginInfo, 1, pstrScreenNm, pstrScreenId, 0, 0, clsMessage.GetMessage("D91000072", txtTantoCd.Text.Trim), "") Response.Redirect(Request.ApplicationPath & "/Main.aspx")
End If
Catch ex As SqlException
lblBtm.Text = rensetu() + clsMessage.GetMessage("E90000001") & Chr(10) & ex.ToString
Catch exc As Exception
lblBtm.Text = rensetu() + clsMessage.GetMessage("E90000001") & Chr(10) & exc.ToString
End Try
End Sub
----------------------------------
上面的代码但是页面跳转情况很正常。到了"/Main.aspx“。
但是单步跟踪的话,会发现代码总会到Catch exc As Exception,
exc是theadabortexception类型,
问题好像是出在Response.Redirect,好像是cache问题?怎么解决这个问题???
Redirect 调用 End,该方法在完成时引发 ThreadAbortException 异常。
tryCatch e As ThreadAbortExceptioncatch e as Exceptionend try