Gaurav_0093 Gaurav_0093 - 3 months ago 20
ASP.NET (C#) Question

What is the difference between Responce.Redirect and Response.RedirectLocation?

If I redirect a page using

Response.RedirectLocation ="login.aspx"
then how it is different form
Responce.Redirect("~/login.aspx")
?
Thanks

Answer

RedirectLocation sets the Location HTTP header. Redirect does so much more and completes the response with a 3xx status code.