asp.net mvc custom routes with multiple submit buttons
- by dangerisgo
So I have a custom route as such:
routes.MapRoute(
"Wizard", // Route name
"Wizard/{page}", // URL with parameters
new { controller = "Wizard", action = "Index" } // Parameter defaults
);
and have the following on my View:
<% Html.BeginForm("Continue", "Wizard"); %>
<input type="submit" value="Continue" name="Continue" />
<% Html.EndForm(); %>
In which I want to call this function:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Continue(string Number, string Rev)
{
(...)
}
but in turn when that button is pressed always calls the postback Index rather than the one I want. If I remove the custom route, it calls my function, but what I want to be displayed in the address bar is: localhost:xxxx/Wizard/1 where the number at the end is the page (div shown) of the wizard either 1, 2, 3, or 4. So is there something I'm missing or can it not be done? Thanks.