public ActionResult MarkHandler(FormCollection form) { string username = form["username"].Trim(); string classId = form["classId"].Trim(); int classNumber = Convert.ToInt32(form["classNumber"]); int score = Convert.ToInt32(form["score"]); Homework homework = new Homework() { StudentUsername = username, ClassId = classId, ClassNumber = classNumber, Score = score }; HomeworkModel homeworkModel = new HomeworkModel(); homeworkModel.Update(homework); return(RedirectToAction("ViewHomework", new { classId, classNumber })); }