I am posting a very simple form using a method I have used frequently in the past. It may be easier to show my code rather than type a lengthy explanation. Here\'s the HTML:
I see that this question is already answered. Following is another approach I used in a MVC view, when the form collection was empty. Using JavaScript / jQuery, it sets name-value pairs to a hidden control which gets appended to the form.
JavaScript / jQuery
$("#btnExport").click(function (event) {
event.preventDefault();
//Append the parameter to the form
var practiceVal = $('#Practice').val();
$('').attr('type', 'hidden')
.attr('name', "Practice").attr('value', practiceVal)
.appendTo('#formHome');
//Submit
$('#formHome').submit();
});
Form
Refer Forms
When a form is submitted for processing, some controls have their
namepaired with their current value and these pairs are submitted with the form