Javascript 如何顺序调用相同的控制器方法而不在客户端使用async:false?
我需要调用Javascript 如何顺序调用相同的控制器方法而不在客户端使用async:false?,javascript,html,model-view-controller,Javascript,Html,Model View Controller,我需要调用“CodeListLookup”方法,当在客户端加载页面时,该方法在控制器中两次使用不同的值。目前它的工作如预期,但不是第一次?我通过添加async:false解决了这个问题。但我需要一个替代方案来克服这个问题?下面我添加了Javascript代码 RepairEstimatePriorities: new kendo.data.DataSource({ transport: { read: {
“CodeListLookup”
方法,当在客户端加载页面时,该方法在控制器中两次使用不同的值。目前它的工作如预期,但不是第一次?我通过添加async:false
解决了这个问题。但我需要一个替代方案来克服这个问题?下面我添加了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",
}
}
}),
谢谢你的帮助
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",
}
}
}),
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",
}
}
}),
下面是我收到的错误:
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