如何在MVC4中获得动态填充下拉的值 [英] How to get value of dynamically fill dropdown in MVC4
本文介绍了如何在MVC4中获得动态填充下拉的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友
我使用JQuery填充下拉列表(ddlVC),我希望在控制器操作中获得ddlVC的选定值。
但它的返回空值
我知道如何获得它?
Hello friends
I have filled dropdown(ddlVC) using JQuery, I want to get the selected value of ddlVC in controller action.
but its returning null value
Any idea how will i get it??
推荐答案
解决方案:
- 查看代码
Solution :
--View Code
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<script src="http://code.jquery.com/jquery-1.10.1.js"></script>
<script>
(document) .ready(function(){
(document).ready(function () {
(#ddl)。change(function(){
var i =
("#ddl").change(function () { var i =
这篇关于如何在MVC4中获得动态填充下拉的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文