我尝试使用 Dojo 从 .ASPX 页面调用 ASP.NET MVC Action 方法。但它显示以下错误..
RequestError:无法加载未定义的状态:404
我的代码如下:
function SearchUser() {
var userName = document.getElementById("txtUserName").value;
var firstName = document.getElementById("txtFirstName").value;
var lastName = document.getElementById("txtLastName").value;
var applicationName = document.getElementById("txtApplicationName").value;
var roleName = document.getElementById("txtRoleName").value;
var locationType = document.getElementById("txtLocationType").value;
var location = document.getElementById("txtLocation").value;
var userType = document.getElementById("txtUserType").value;
var isAdmin = document.getElementById("chkAdmin").checked;
var searchUserParameters = { "pageIndex": "1", "pageSize": "100", "userName": ""+ userName +"", "firstName":""+ firstName +"", "lastName":""+ lastName +"", "userType":""+ userType +"", "appName":""+ applicationName +"", "roleName":""+ roleName +"", "LocationType":""+ locationType +"", "location":""+ location +"", "isAdmin":""+ isAdmin +"" };
var xhrArgs = {
postData: dojo.toJson(searchUserParameters),
handleAs: "text",
headers: { "Content-Type": "application/json", "Accept": "application/json" },
load: function (data) {
document.getElementById("svsOutput").innerHTML = data;
},
error: function (error) {
alert("Error occured:" + error);
}
}
var deferred = dojo.xhrPost(xhrArgs);
return false;
}
有人可以建议我有什么问题吗?