Posted in Javascript onJune 09, 2013
$(document).ready(function () { loadSchools(); }); function loadSchools() { var url = "@Url.Action("GetSchools")"; $.ajax({ url: url, type: "GET", dataType: "json", error: function () { alert("Error"); }, success: function (data) { var items = ""; $.each(data, function (i, school) { items += "<option value=\"" + school.SchoolId + "\">" + school.SchoolName + "</option>"; }); $("#SchoolId").html(items); } }); }
Jquery加载时从后台读取数据绑定到dropdownList实例
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@