using System.Collections.Generic;
namespace HelloWorldMvcApp
public class HomeController : Controller
public ActionResult Index()
var values = new List<dynamic>
new { value = 0 , text = "0"},
new { value = 1 , text = "1"},
new { value = 2 , text = "2"},
new { value = 3 , text = "3"},
new { value = 4 , text = "4"},
new { value = 5 , text = "5"},
new { value = 6 , text = "6"},
new { value = 7 , text = "7"},
new { value = 8 , text = "8"},
new { value = 9 , text = "9"}
ViewBag.combo = new SelectList(values, "value", "text");
public JsonResult GetSecondComboData(int val)
return Json(Enumerable.Range(0, val+1), JsonRequestBehavior.AllowGet);