I have the problems with pass list of string into controller in mvc 3 Razor
I use Jquery to set value.
But in the server side the first value always false, I don't know why :(
Here my code:
Class:
public class ListFieldInfo
{
public List<string> FieldFilters { get; set; }
}
View:
@using (Html.BeginForm("Export", "Books", FormMethod.Post,new { @id = "exportForm", hidden = true }))
{
<fieldset>
@Html.HiddenFor(m => m.status_info.FieldFilters, new { @id = "status_filters" })
</fieldset>
}
Javascript:
$('#status_filters').add("0");
$('#status_filters').add("1");
Debug in controller:
FieldFilters[0] = "false"// I don't know why
FieldFilters[1] = "1"
I tried to search google and stackoverflow but still no help
Please help me, thank in advance