当前位置:编程学习 > C#/ASP.NET >>

mvc dropdownlist change事件为什么有时无法触发

view:js code:
        $(document).ready(function () {
            $("#ddlGroup").change(function () {
                debugger;
                var idModel = $(this).val();
                document.getElementById("hidGroupId").value = idModel;
                $.getJSON("/GroupItem/LoadGroupItemModelById", { id: idModel },
function (carData) {
    alert(carData.Remark);
    document.getElementById("txtGroupName").value = carData.GroupName;
    document.getElementById("txtRemark").value = carData.Remark;
    var funtionList = carData.FunctionList;
    for (var i = 0; i < funtionList.length; i++) {
        var chkFun = document.getElementById(funtionList[i].FunctimeCode.toString());
        if (funtionList[i].IsChecked == 1) {
            chkFun.checked = true;
        }
        else {
            chkFun.checked = false;
        }
    }

});
            });

        });



controller:
[AcceptVerbs(HttpVerbs.Get)]
        public ActionResult LoadGroupItemModelById(string id)
        {
            var modelList = this.GetGroupItemModel(Convert.ToInt32(id))[0];
            return Json(modelList, JsonRequestBehavior.AllowGet);
        }

问题 :我在controller设置一个断点,有时无法进来。比如下面case是无法进来的:我先获取dropdownlist里面的一条详细记录,然后修改它。再回来改变dropdownlist 的选项,此时可以触发断点,然后再选中刚刚修改的那条记录就无法触发断点了。真的很奇怪,请高手赐教,谢谢。
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,