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
You want Html.BeginRouteForm("RegisterConfirmationRoute")
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With