In my QuestionModel I have:
private List<QuestionModel> _questionList = new List<QuestionModel>();
Which I use in my view:
//GetQuestionList returns the _questionList
foreach (var item in Model.GetQuestionList()){...}
I want to acces my model in the controller when I submit my form in the view.
I have tried to add the model as a parameter in de controller function like:
public ActionResult SaveData(QuestionModel model){}
But I get nothing in it So my question is, is it possible and how to do it?
您将需要绑定回Model
的类型,并在视图中使用for
循环而不是for each
循环。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.