i'm using the following post type:
<% using (Html.BeginForm())
{ %>
<%= Html.Hidden("EligiblePages", Model.EligiblePages) %>
.... no elements in list appear
$('.btnAction').click(function() {
$.post("Home/AddProduct", $('form').serialize(), function(retval) { $('#addProductDialog').html(retval); });
});
public class ProductViewModel
{
public List<string> EligibleProducts { get; set; }
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult AddProduct(string sender, ProductViewModel model)
{
...
}
i'll update this when i get home and can put together a more precise example.
and in my ViewModel that is getting posted i have a list<string> as a hidden input field. for some reason when the post occurs and i inspect the controller post method that field is not coming over correctly. any ideas?