public ActionResult Index() { var environments = new SelectList(new[] { new { ID = 0, Name = string.Empty }, new { ID = 1, Name = "Jake" }, new { ID = 2, Name = "Tom" }, new { ID = 3, Name = "Dan" }, new { ID = 4, Name = "Stu" }, new { ID = 5, Name = "Pete" } }, "ID", "Name"); ViewData["Environments"] = environments; return View(); } cshtml code <div align="center">@Html.DropDownList("Environments", ViewData["Environments"] as SelectList) </div> <div align="center"></div>@{Html.RenderAction("ShowGrid");} <section id="scripts"> <script type="text/javascript"> $('#Environments').change(function () { ApplicationErrors.Refresh(); }); </script> </section>` Js code function OnBeginCallback(s, e) { e.customArgs["environment"] = $('#Environments').val(); }`
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)