I think you will have a problem with binding complex types to your model. If you do not. Here is an alternative way.
You have a set of checkboxes, possibly with the same name and different values. You can send them to a method that takes a FormCollection, i.e.
public ActionResult Test(FormCollection collection) { string results = collection["Blanks"]; }
This will give you a comma-separated list of values ββ(or null if the checkboxes are unchecked).
Alternatively, if you have possible values ββin the form of an array on the server, you can specify the flag names according to their array values, which would mean that you could do something like this:
@using (Html.BeginForm("Test","Home")) { @Html.CheckBox("Blanks[0]", false); @Html.CheckBox("Blanks[1]", false); @Html.CheckBox("Blanks[2]", false); <input type="submit" value="Submit" /> }
gives you an array of logic elements in a test method:
public test ActionResult (bool [] Forms) {}
Ashish charan
source share