protected void Button1_Click(object sender, EventArgs e) { try { DataSet ds1 = new DataSet(); db.executenonproce_withoutparams("sp_replace_det_alpha", out ds1); Response.Redirect("ClientDetails.aspx",false); } catch (ThreadAbortException ex1) { if (ex1.Message == "Thead was being aborted.") { Response.Redirect("ClientDetails.aspx", false); } } }
Response.Redirect("ClientDetails.aspx", true);
Quote: The correct pattern is to call the Redirect overload with endResponse=false and make a call to tell the IIS pipeline that it should advance directly to the EndRequest stage once you return control: C# Response.Redirect(url, false); Context.ApplicationInstance.CompleteRequest(); This blog[^] post from Thomas Marquardt provides additional details, including how to handle the special case of redirecting inside an Application_Error handler.
Redirect
endResponse=false
EndRequest
Response.Redirect(url, false); Context.ApplicationInstance.CompleteRequest();
Application_Error
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)