hello,
i have this checkbox list bind with list working fine
on button submit event i want to get all the selected checkboxlist value as comma seperated in my string on my controller
@model IEnumerable<MVCApp.Models.FirstCategories>
@using (@Html.BeginForm("CheckboxListTopcategoryMenu_post", "Application", FormMethod.Get))
{
foreach (var item in Model)
{
@Html.CheckBoxFor(m => item.isSelected)
@Html.DisplayFor(m => item.Title)
@Html.HiddenFor(m => item.id)
}
<input id="Button2" type="submit" class="btn red" value="Search" />
}
but it gives error pls advice
public ActionResult CheckboxListTopcategoryMenu_post(List<FirstCategories> categoryselected)
{
string _searches = "";
foreach (FirstCategories cat in categoryselected)
{
_searches = cat.isSelected.ToString();
}
return View();
}