部分视图中选择的索引更改事件mvc4 razor [英] selected index change event in partial view mvc4 razor
本文介绍了部分视图中选择的索引更改事件mvc4 razor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
@Html.DropDownList("StateDropDown", new SelectList(Model, "VentureLocationID", "VentureLocationName"),"Projects", new { @id = "StateDropDown" })
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$("#StateDropDown").change(function () {
$.ajax({
type: 'GET',
url: @Url.Action("Index","Venture")+ this.value,
});
});
});
</script>
i我将数据输入到下拉列表。基于datavalue字段我想重定向到控制器中的相应操作。但是事件不公平。任何人都建议请
i am getting data in to dropdown list.based on the datavalue field i want to redirect to the corresponding action in a controller.but event is not fairing.can any one suggest please
推荐答案
(文件).ready(function(){
(document).ready(function () {
( #StateDropDown)。change(function(){
("#StateDropDown").change(function () {
.ajax({
type:'GET',
url:@ Url.Action(Index ,冒险)+ this.value,
});
});
});
< / script>
.ajax({ type: 'GET', url: @Url.Action("Index","Venture")+ this.value, }); }); }); </script>
i我将数据输入到下拉列表。基于datavalue字段我想重定向到控制器中的相应操作。但是事件不公平。任何人都建议
i am getting data in to dropdown list.based on the datavalue field i want to redirect to the corresponding action in a controller.but event is not fairing.can any one suggest please
这篇关于部分视图中选择的索引更改事件mvc4 razor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文