Guest User

Untitled

a guest
May 1st, 2012
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. how can i set atributes to @Html.DropDownList
  2. table sample
  3. {
  4. id,
  5. studentid,
  6. courseid,
  7. grade,
  8. studentTeacher
  9. }
  10.  
  11. ViewBag.Student= new SelectList(db.Course.Where(c => c.StudentId== id), "StudentId","FullName");
  12. ViewBag.CourseId = new SelectList(db.Course, "CourseId ", "Name");
  13. ViewBag.StudentId = new SelectList(db.Student, "StudentId","FullName");
  14.  
  15. @Html.DropDownList("Student")
  16. @Html.DropDownList("CourseId ")
  17. @Html.DropDownList("StudentId ", string.Empty)
  18.  
  19. @Html.DropDownList("Student", ViewBag.Student)
  20. // etc.
Advertisement
Add Comment
Please, Sign In to add comment