MVC post a list of complex objects

前端 未结 5 1908
眼角桃花
眼角桃花 2020-11-30 06:41

I have a FeedbackViewModel that contains a list of questions:

public class FeedbackViewModel
{
    public List Questions { get; set;         


        
5条回答
  •  广开言路
    2020-11-30 07:31

    Make sure you are rendering your view in order so that Model.Questions[i] renders in order.

    For example, Model.Questions[0], Model.Questions[1], Model.Questions[2]. I noticed that if the order is not correct mvc model binder will only bind the first element.

提交回复
热议问题