Controller:
public ActionResult searchGroup(int groep)
{
var returnValue = convertWerkvorm(db.Werkvormens.Where(f => f.GroepenWerkvormID == groep).ToList());
return View(returnValue);
}
Partialview:
@model alina1617.Models.DropDownModel
<h2>Groepen</h2>
<div>
<div><select id="@Html.IdFor(m => m.selectedItem)" name="@Html.NameFor(m => m.selectedItem)">
@foreach (var groepModel in ViewBag.groepen)
{
<option value="@groepModel.id" title="@groepModel.Beschrijving">@groepModel.Naam</option>
}
</select>
<input type="button" id="zoekgroep" value="Zoeken" onclick="location.href='@Url.Action("Create", "WerkvormController")'" />
</div>
</div>
I want to pass the id of the selected group to the controller when my button is clicked. Should I use Jquery or can I do this using something MVC related?