I want to call MarriageById
as GET, like this:
var url = \'/MarriageById?id=\' + id;
But I also want to have a single Action
Using RedirectToAction
always implies a GET, so this won't work to reach the Marriage
action method that only accepts POST.
However there is nothing wrong with calling the other method yourself, it is still a method like any other. So try this instead:
return Marriage(marriage);
And on a side note: if the Marriage
method will always only be used to display data, and never to save, store or change data, then using POST is not the best choice. POST typically implies a call with side effects (save, store, change, or even delete), and in general it is best to stick to that convention.