I’ve been using EXTJS 4 and loading my stores through an AJAX call to a Webmethod on the codebehind of an .aspx page. This method has worked for all of my projects until I tried porting my EXTJS 4 work into a MVC3 project. My calls are now returning 404.
The key part is that the project (and the EXTJS4 webmethod calls) works on my colleagues’ machines – only my machine is affected by this ‘404’ error. Any Webmethod call, be it one of theirs or written by me, returns as ‘Resource Not Found’. What’s going on?
Some code if it helps:
To Load the Store:
Ext.define('pr.store.Store-Items', {
extend: 'Ext.data.Store',
model: 'pr.model.Model-Items',
pageSize: 200,
groupField: 'groupID',
autoLoad: { params: { start: 0, limit: 200 } },
proxy: {
type: 'ajax',
//get data from json file for now
headers: { 'Accept': 'application/json, text/javascript, */*; q=0.01', 'Content-Type': 'application/json; charset=utf-8' },
url: '/Project/Data.ashx/GetData',
reader: {
type: 'json',
root: 'd.objects',
totalProperty: 'd.totalCount'
},
extraParams: {
where: Ext.encode(new Array(''))
, difference: true
, mode: 0
}
}
});
WebMethod
[System.Web.Script.Services.ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Json, UseHttpGet=true)]
[System.Web.Services.WebMethod]
public static object GetData(int start, int limit, string[] where, bool difference, int mode)
{
//Code
}
Can be a lot of different things. Starting with wrong configuration of IIS. If you put this URL into browser – do you get anything.