I am taking my first teetering steps with submitting Html forms using jQuery. All works well, but would like to use the T4MVC to generate the action link.
This works with Html.BeginForm (and Ajax.BeginForm) because they take an ActionResult as the action generating param. Ie:
Is there a way to do:
<form method="POST" action="@MVC.???">
I suppose I could do:
@using (Html.BeginForm(MVC.MyArea.MyController.MyAction(),...,new {@id="myForm"}))
{
// Inputs
}
But really wonder if T4MVC can handle this. Suspect not, but am new to it, so maybe am missing something?
(And yes, I know about Ajax.BeginForm, but am using the current project to learn more about MVC and jQuery).
The following should work:
<form method="POST" action="@Url.Action(MVC.MyArea.MyController.MyAction())">
Or if you need to add extra route values:
<form method="POST" action="@Url.Action(MVC.MyArea.MyController.MyAction().AddRouteValues(new { @id = "myForm" }))">
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