Model binding problem
I have this code
public class Room
{
public string Id { get; set; }
public List<person> people { get; 开发者_Python百科set;}
}
}
public class person
{
public int Id { get; set; }
public string Name { get; set; }
}
I'm trying to bind a list of person and place it in the room object
I create my textboxes for person name and I name them people[index].Name I can bind them to a list of person (by removing people) but I cant bind them to the Rooms people object. Is there a way?
public ActionResult([Bind(Prefix="people")]person p)
Hi I figured out the answer
In mvc 2 you need an index and in 3 you don't (wrt Non-Sequential Indices). This site provides some insight
I'm sorry I never give you guys enough information to answer this question. I work with multiple solutions it's difficult for me to keep track right now.
Thanks for the reply.
精彩评论