I want to redirect to an action method of another controller such that the browser issues POST instead of GET verb.
Is it possible to do that?
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.
Well the nature of a “redirect” in HTTP terms is an instruction to the browser to perform a HTTP GET to a particular URL.
So, in HTTP terms – it’s not possible.
However 🙂
Instead of doing
RedirectToAction("ActionMethod", "Controller", new { param = value }), you could doreturn View("ActionMethod", value)which would pass thevalueas a key/value pair in the HTTP POST body, assumingActionMethodis setup with[HttpPost], like so:However, keep in mind that will not perform a redirect – it’s like of the equivalent of a cross-page postback in ASP.NET Web Forms.