What is the difference between the following two controller ActionResult return statements:
return new RedirectResult("http://www.google.com", false);
and
return Redirect("http://www.google.com");
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
straight from the source
The second argument determines whether the response is a 302 (temporary) or 301 permanent redirection. By default, the value is
false.The second method is on
Controllerand is simply a convenience method. This method has been around for a number of versions of MVC (as far back as at least 2), but IIRC, the addition of the Permanent part toRedirectResultI think has come in in MVC 4 (I don’t recall seeing it in MVC 3).