
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 0.52 KB | hits: 22 | expires: Never
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.