I have the following Html.BeginForm
(Do not take into account if it is incorrect is a legacy code and I can not refactor this now).
using (Html.BeginForm("Confirm", "Download", new { ContributorID = "exemplo"}, FormMethod.Post, new { id = "confirm" })) {
<div class="form-group">
<label for="work_select">Selecione uma obra existente:</label>
<select class="form-control" id="work_select">
<option value="0" selected="selected">Selecione uma obra</option>
</select>
</div>
<p id="error-message"></p>
@Html.AntiForgeryToken()
<div class="inner-addon left-addon">
<i class="fa fa-download" aria-hidden="true"></i>
<input type="submit" value="@MainMessages.confirm_your_download" class="button-download" style="width:100%" />
<br />
</div>
}
Controller:
[HttpPost]
public ActionResult Confirm(string contributorID,string work_select)
If you noticed there is a parameter being added without using an input new { ContributorID = "exemplo"}
, I need this to continue , but <select>
is not passing work_select
to controller, it gets null
, how can I do that?