如何使用asp.net mvc将数据绑定到angularjs中的dropdownlist [英] how to bind data to dropdownlist in angularjs using asp.net mvc

查看:85
本文介绍了如何使用asp.net mvc将数据绑定到angularjs中的dropdownlist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hiii,



我想知道如何使用angularjs将数据绑定到下拉列表。



i在sql server中有一个department表,我想使用angularjs将deptname和deptId绑定到下拉列表。



我该怎么做?



在这方面的任何帮助都非常感谢..



在此先感谢.. :))

解决方案

你可以创建一个返回json结果的ActionMethod,并用例如带有angular的


http的javascript调用它。那里有很多例子。


编写一个返回Json结果的ActionResult方法,如下所示



 

Hiii,

I would like to know how to bind the data to dropdownlist using angularjs.

i have a department table in sql server and i wanted to bind the deptname and deptId to the dropdownlist using angularjs .

How can i do that?

any help in this regard is highly appreciated..

Thanks in Advance..:)

解决方案

You could make a ActionMethod that returns a json result and call it form javascript with angular's


http for example. There are lot of examples out there.


Write a ActionResult Method that returns Json result like following


这篇关于如何使用asp.net mvc将数据绑定到angularjs中的dropdownlist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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