如何在mvc中执行选定的索引更改事件 [英] how to Perform Selected index changed event in mvc

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

问题描述

Hello Friend,

我想执行国家下拉选择和状态下拉列表绑定在mvc

Hello Friend ,
I Want To Perform A Country Dropdown Select and State Dropdown Bind in mvc

推荐答案

你必须处理jQuery中select元素的'change'事件,基本上通过ajax调用做你想要的东西。



You have to handle the 'change' event of the select element in jQuery and do the stuff you want through ajax calls basically.


' #ddlCountry')。change(函数(){
// 执行stuff操作以绑定状态,如图所示在
});
('#ddlCountry').change(function() { // do the stuff operation to bind states as shown below });





使用jQuery方法.ajax()填充此处的状态下拉列表。希望下面的鳕鱼示例肯定对您有所帮助: -



Ex





Use jQuery method .ajax() to populate the state dropdown here. Hope the below cod eexample will definitely of help for you :-

Ex


.ajax({
type: POST
url: ../ WebService.asmx / GetAllStates
数据: {CountryID:' +
.ajax({ type: "POST", url: "../WebService.asmx/GetAllStates", data: "{CountryID:'" +


这篇关于如何在mvc中执行选定的索引更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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