如何在客户端不使用async:false的情况下顺序调用相同的控制器方法?

时间:2016-12-23 07:07:29

标签: javascript html model-view-controller

我需要在客户端加载页面时调用控制器中的"CodeListLookup"方法两次,具有不同的值。目前它按预期工作,但不是第一次?我通过添加async: false来解决这个问题。但我需要一个替代解决方案来克服这个问题?下面我添加了Javascript代码?

感谢您的帮助......

JavaScript:

 RepairEstimatePriorities: new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: '@Url.Action("CodeListLookup", "GeneralData", new { Area = "Settings" })/?codeListType=PriorityType',
                            dataType: "json",
                            contentType: "application/json; charset=utf-8",
                            type: "GET"
                        }
                    }
                }),

                RepairEstimateServiceTypes: new kendo.data.DataSource({
                    transport: {
                        read: {
                            type: "GET",
                            datatype: "json",
                            url: '@Url.Action("CodeListLookup", "GeneralData", new { Area = "Settings" })/?codeListType=ServiceType',
                            contentType: "application/json; charset=utf-8",
                        }
                    }
                }),

获得以下错误:

Uncaught TypeError: e.slice is not a function

0 个答案:

没有答案