2つのSelectListを1つのビューで表示したいと思います。つまり、私は1つのActionResultを使ってビューをレンダリングできます。複数の選択リストを1つのアクション結果で返します
public ActionResult IndexStudents(Docent docent, int lessonid, int classid)
{
return View(new SelectList(docent.ReturnStudentsNormalAsString(lessonid, classid)));
return View(new SelectList(docent.ReturnStudentsNoClassAsString(lessonid, classid)));
}
もちろん、これは機能しません。どうすれば修正できますか?おそらく辞書を使用していますか?
私は私の出力は次のようになりたい:通常の学生と1とレッスンのために加入していない学生と1 ...
<div class="editor-field">
<%: Html.DropDownList("IndexStudentsNormal",
Model as SelectList) %>
</div>
<div class="editor-field">
<%: Html.DropDownList("IndexStudentsNoClass",
Model as SelectList) %>
</div>
だから私は2つのモデル、各SelectListのための1つを使用したいです。
どうすればいいですか?