在MVC中下拉列表的选定索引更改 [英] selected index change of dropdown in mvc

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

问题描述

我创建了3个控制器,即国家控制器,州控制器和财产主控制器及其对应的视图.我在国家和州添加了值.
我想在我的propertymain视图中根据国家获得州的信息.如何使用mvc3剃须刀应用程序实现此目的?有人可以帮助我吗?

I created 3 controllers namely country controller, state controller and property main controller and their corresponding views. i added values in country and states.
i want to get state according to country in my propertymain view. How can i implement this using mvc3 razor application? can anyone help me?

推荐答案

我认为您可以在单个控制器中完成所有方法.此问题无需带3个控制器.

我建议您使用jQuery并通过JSON绑定数据.

-Sagar
I think you could have done all method in a single controller. No need to take 3 controller for this issue.

I would suggest you to go with jQuery and Bind data through JSON.

-Sagar


查看以下内容:

在MVC中使用JSON [ ^ ]

-萨加尔·索兰基(Sagar Solanki)
Check out following :

Using JSON in MVC[^]

-Sagar Solanki


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

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