id | title | visible |
1 | San Diego, CA | true |
2 | Los Angeles, CA | true |
3 | Austin, TX | false |
DropDown List (razor format)
@Html.cities("id", String.Empty)
Original:
ViewBag.cities= new SelectList(db.cities, "id", "title", myitem.cityId);
Modified:
ViewBag.cities= new SelectList(db.cities.Where(g => g.visible == true), "id", "title", myitem.cityId);
0 comments:
Post a Comment