I have added a code to fetch values from a database to show multiple checkboxes as shown below on my view page
@{
var dept_list = ViewBag.department_list;
}
@foreach (var dept_item in dept_list)
{
<input type="checkbox" id="dept_checkbox" name="@dept_item.name" value="@dept_item.department_ID" />
<span class="rmargin20">@dept_item.name</span>
}
Now I want to get the values of the checked checkboxes, and want to save these values to the database. The above mentioned code will generate the checkboxes for each record in database.
This can be done in asp.net. But i want to implement this feature in MVC.