绑定MVC中的多个下拉列表 [英] Bind the multiple Dropdown list in MVC

查看:81
本文介绍了绑定MVC中的多个下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我正在学习MVC。我能够绑定一个简单的下拉列表。

但是我怎样才能在MVC中获得selectedindexchanged事件?

如何从第一个下拉列表中绑定另一个下拉列表?选择索引?
假设我有第一个国家/地区下拉列表。我想在国家的基础上绑定州。

我如何在MVC中做这些事情?



请帮助我...... 。

Hello,

I am learning with MVC. I am able to bind simple one dropdown list.
But how can i get selectedindexchanged event in MVC?
How can i bind another dropdownlist from first dropdown selectedindexchaged?
Suppose i have first country dropdown list. I want to bind states on the basis of country.
How can i do this things in MVC?

Please help me....

推荐答案

我会使用 jQuery 来做客户端。



这里是如何使用jQuery的示例使用选择对象。只需修改它以使用ajax调用更新另一个选择对象。



以下是这种解决方案的链接:http://www.codeassembly.com/examples/jquerycombo/test.html [ ^ ]
I would use jQuery to do it client side.

Here is an example of how to use jQuery with a select object. Just modify this to update another select object with an ajax call.

Here is a link to just such a solution: http://www.codeassembly.com/examples/jquerycombo/test.html[^]


这篇关于绑定MVC中的多个下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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