Populate dropdown list based on data retrieved from database in MVC Application (VIEW)

View jquery function getRelation() { $.ajax ({ url: "@(Url.Action("FillRoles", "Roles"))", data: {}, success: function (result) { var html = ""; html += "<option>Select</option>"; for (var i = 0; i < result.length; i++) { html += "<option value=" + result[i].ID + ">" + result[i].Description + "</option>"; } $("#ddlAddRoles").html(html); } }); } html <div class="col-sm-4 tb-font"> <form>... Continue Reading →

Blog at WordPress.com.

Up ↑

Design a site like this with WordPress.com
Get started