In my razor view, I\'m using a Html.BeginForm
. In it I have two elements where when I set clic, should submit the form but I need to add an additional string pa
Based on your comments, the easiest thing for you to do is make your buttons of type submit
and give them a name
. If they have a name
, the value
of the button that is clicked will be sent automatically with the form post, see: sending form's submit button's value?
Example:
When the a
button is clicked, parameter
will be posted with value a
. Likewise for b
and c
. If the none
button is clicked, no value will be sent and parameter
will be null
(shown for demonstration purposes, you may not need this).
@using (Html.BeginForm("Index", "Quiz", FormMethod.Post, new { id = "form" }))
{
...
}