@Html.CheckBox(\"orderNumbers\", new { value = 1 })
@Html.CheckBox(\"orderNumbers\", new { value = 2 })
@Html.CheckBox(\"orderNumbers\", new { value = 3 })
@Html.CheckBo
You can get all the checked values by the following way.
Controller code :
public ActionResult Index()
{
return View();
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index(string[] orderNumbers)
{
return View();
}
View Code :
@using (Html.BeginForm())
{
}
Please keep one thing in my mind that, you need to give same name to all checkboxes. In array you will get values for all checked checkboxes.