raza sarwar raza sarwar - 3 years ago 93
C# Question

through exception while redirecting

Why debugger going into catch block. What's the issue?? kindly tell me.

exception:"Thread was being aborted".

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

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

throw;
}
}

Answer Source

Response.Redirect throws “System.Threading.ThreadAbortException” exception.

Try using an overload, Response.Redirect(String url, bool endResponse) that passes false for the endResponse parameter to suppress the internal call to Response.End.

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download