Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个要输入两个不同日期的视图,因此我希望这两个日期之间的数据库中的所有条目都应显示在下拉列表中。我怎样才能做到这一点?????
从您的控制器返回这两个日期之间的条目列表,例如
enteries.Where(a => a.startdate < FirstDate && a => a.enddate < SecondDate ).ToList()
然后将这些条目传递给 DropDownListFor 之类的
@Html.DropDownListFor(model => model.entryID, new SelectList(model.entries, "ID", "Title"))