[HttpPost] public ActionResult getCicites(int provinceId) { var cities = db.cities.Where(a => a.provinceId == provinceId).Select(a => "<option value='" + a.cityId + "'>" + a.cityName + "'</option>'"; return Content(String.Join("", cities)); }
<select id="ddl"></select>
var id = 1; // Your id $.ajax({ type: "POST", url: '@Url.Action("getCicites", "YourControllerName")', data: { provinceId: id}, success: function (d) { $('#ddl').append(d); } });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)