MVC .Net create model and related models at same time

怎甘沉沦 提交于 2019-12-02 10:11:50
Mitius

I started learning mvc few days ago and today I had to do something similar.

I wanted to save multiple dates at the same time. Here is the simplified code:

View:

<input type="text" name="Date" />

Controller:

public ActionResult Create(List<DateTime> Date)
{
    //Saving goes here
}

This way date from every text field named "Date" will be available in List Date.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!