mvc 4 beginform with route name

asp.net-mvc

Solution

You want `Html.BeginRouteForm("RegisterConfirmationRoute")`.

Problem

I'm generating a form in MVC using `@Html.BeginForm()`, but my form has to post to my confirmation action which will render the confirmation view. The confirmation action is easy enough to get to, but the user will be redirected there as well and my mapped route looks like this: ``` routes.MapRoute( name: "RegisterConfirmationRoute", url: "register/confirmation", defaults: new { controller = "Account", action = "ConfirmRegistration" } ); ``` Am I going about this the wrong way? I don't see how I can get `@Html.BeginForm` to use the routeName to render the form's action attribute? Regards, Jacques

Original source