Response.Redirect catch try :
try
{
Session["objtwitter"] = obj_UserDetSumit;
}
catch (Exception ex)
{
lblStatus.Text = "Account Creation Failed, Please Try Again";
return;
}
Response.Redirect("TwitterLogin.aspx");
, Response.Redirect("TwitterLogin.aspx", false);, . , .
, Response.Redirect catch try. Response.Redirect(url); Response.End();, ThreadAbortException.
, - .
Using a Reflector , you can see what Response.Redirect(url);causesResponse.Redirect(url, true);
Passing true then calls Response.End();, which looks like this:
public void End()
{
if (this._context.IsInCancellablePeriod)
{
InternalSecurityPermissions.ControlThread.Assert();
Thread.CurrentThread.Abort(new HttpApplication.CancelModuleException(false));
}
....
}
Even if you don’t have the final piece of code, it might try to execute "empty", but it cannot, because the stream is interrupted. Just a thought.
source
share