I have two actions in a controller:
public ActionResult ReportRequest()
{
return View();
}
[HttpPost]
public ActionResult Report(ReportRequestObj rr, FormCollection formValues)
{
if (Request.HttpMethod != "POST")
return RedirectToAction("ReportRequest");
ReportingEngine re = new ReportingEngine();
Report report = re.GetReport(rr);
return View(report);
}
My problem is, the URL for the 'Report' page gets saved in the browser, and when I click on it, I get a 404, because the request has not been posted.
I put in a handler in to redirect to the report request page however on debugging it just doesn't seem to hit this at all.
Is there any other way I can determine if the request is a post, and if not redirect back to another page?
Thanks