Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- how can i set atributes to @Html.DropDownList
- table sample
- {
- id,
- studentid,
- courseid,
- grade,
- studentTeacher
- }
- ViewBag.Student= new SelectList(db.Course.Where(c => c.StudentId== id), "StudentId","FullName");
- ViewBag.CourseId = new SelectList(db.Course, "CourseId ", "Name");
- ViewBag.StudentId = new SelectList(db.Student, "StudentId","FullName");
- @Html.DropDownList("Student")
- @Html.DropDownList("CourseId ")
- @Html.DropDownList("StudentId ", string.Empty)
- @Html.DropDownList("Student", ViewBag.Student)
- // etc.
Advertisement
Add Comment
Please, Sign In to add comment