2017-07-25 110 views
0

为什么调试器进入catch块。有什么问题?请告诉我。通过异常重定向

异常:“线程正在中止”。

protected void lnkResponse_Click(object sender, EventArgs e) 
    { 
     try 
     { 
      Session["idTicket"] = hfIdTicket.Value; 

      Response.Redirect("~/Forms/TicketChat.aspx"); 
     } 
     catch (Exception) 
     { 

      throw; 
     } 
    } 
+3

我们应该如何知道你是否甚至不告诉我们你得到了什么样的例外? – waka

+0

什么是确切的例外? –

+2

请参阅[this](https://stackoverflow.com/q/2777105/492258)Response.Redirect导致异常 –

回答

0

Response.Redirect引发System.Threading.ThreadAbortException异常。

尝试使用过载Response.Redirect(String url, bool endResponse),通过false参数endResponse来抑制内部呼叫Response.End

Response.Redirect ("~/Forms/TicketChat.aspx", false);