I have a action method in studentController which filter students by classroomId
public ActionResult ClassStudents(int classRoomId)
{
var students = st.GetAll().Where(s => s.ClassRoomID == classRoomId);
var classroom = clr.GetByID(classRoomId);
ViewBag.ClassRoomTitle = classroom.ClassRoomTitle;
return View(students);
}
when i input /Student/ClassStudents/1
it give me a error as:
参数字典包含方法“System.Web.Mvc.ActionResult ClassStudents(Int32)”的不可空类型“System.Int32”的参数“classRoomId”的空条目
你能找到什么问题吗?谢谢