public ActionResult DropdownListFor(DropdownlistModel model) { //posted value is obtained from the model model.data = datasource; model.val = model.val; return(View(model)); }
public ActionResult DropdownListFor() { DropdownlistModel model = new DropdownlistModel(); model.data = datasource; model.val = "Badminton"; return(View(model)); }