如何在MVC4中使用jquary从数据库填充Dropdown [英] How to populate Dropdown using jquary from database in MVC4

查看:80
本文介绍了如何在MVC4中使用jquary从数据库填充Dropdown的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用jquary 从MVC4中的数据库填充下拉列表

How to populate Dropdown using jquary from database in MVC4??

推荐答案

不能比这更好:

ASP.NET中的动态DropDownList绑定MVC数据库 [ ^ ]



-KR
Can't be better than this:
Dynamic DropDownList Binding in ASP.NET MVC With Database[^]

-KR


JavaScript文件代码



JavaScript File Code

function bindDropDown(apiUrl, dropDownId) {


.ajax({
type:GET ,
url:apiUrl,
dataType:json,
成功:函数(结果){
var recordsDocument = jQuery.parseJSON(result);

// Assgin将值记录到下拉列表中
.ajax({ type: "GET", url: apiUrl, dataType: "json", success: function (result) { var recordsDocument = jQuery.parseJSON(result); //Assgin records value into drop down


这篇关于如何在MVC4中使用jquary从数据库填充Dropdown的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆