This is my view page Markup
<%for (int i = 0; i < 3; i++)
{ %>
<%:Html.CheckBox("Test") %>
<%} %>
and this is my controller where i am getting the values from formcollection object
public ActionResult CreateTaxMaster(TaxMaster objTaxMaster ,bool [] Test,FormCollection form)
{
string LocalCheckboxValues = string.Empty;
foreach (var key in form.AllKeys)
{
if (key.Contains("Test"))
{
LocalCheckboxValues = LocalCheckboxValues + form.Get(key);
}
}
i tried all the three way to get the proper values but its giving me some true,false values with mismatch selected values of checkbox
if i select all three checkbox still it is giving the formcollection values in true,false,true,false,true,false
Any help woulde be appriciated. Thanks in advance.