I am new to asp.net development.I am currently working of asp.net web application. While resolving an issue came across exception "thread is being aborted". I went through several article to get deep understanding for the exception.

I read this great article on codeproject by Shivprasad koirala which explained me about the use of Server.Transfer and Response.Redirect.

Then I went to this post by Thomas Marquardt which made me conclude Respose.Redirect(url,false) but better to use

Server.ClearError();
Response.Redirect(url, false);
Context.ApplicationInstance.CompleteRequest();

But again this article by Imrambaloch says there is a security concern using Response.Redirect(url, false), and to instead use

Response.Redirect(url, false);
var context = HttpContext.Current;
if (context != null)
{
    context.ApplicationInstance.CompleteRequest();
}

Now in the end I am a bit confused as which is the recommended way to redirect.

My question: What is the best way to redirect user eliminating the security concerns and performance issues?

Is Server.Transfer really that bad as compared to Response.Redirect?

Related posts

Recent Viewed