Friday, 23 August 2013

ASP.NET, MVC, DOJO: RequestError: Unable to load undefined status: 404

ASP.NET, MVC, DOJO: RequestError: Unable to load undefined status: 404

I have tried to call ASP.NET MVC Action method from .ASPX page using Dojo.
but it is showing the following error..
RequestError: Unable to load undefined status: 404
My code is like below:
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;
}
Can anybody suggest me what is the problem?

No comments:

Post a Comment