Created
April 16, 2012 14:42
-
-
Save vgheri/2399192 to your computer and use it in GitHub Desktop.
KnockoutJS data-bind for DropDownLists with MVC 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionResult Index() | |
{ | |
var numberOfDropDownMenus = 5; | |
for (var i = 0; i < numberOfDropDownMenus; i++) | |
{ | |
var selectList = new SelectList(this.GetDummyItems(i), "Id", "Name", -1); | |
ViewData["Options_" + i] = selectList; | |
} | |
ViewData["DropDownMenus"] = numberOfDropDownMenus; | |
return View(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment