I have a very simple asp.net mvc3 app that uses jquery::getJSON to call into my controller and get some data top display via jquery::tmpl.
function ajaxError(jqXHR, textStatus, errorThrown) {
alert(errorThrown);
}
....
$.ajaxSetup({
cache: false,
error: ajaxError // tell me what the error was
});
var cl = $("#listcontainer");
$(cl).empty();
$.getJSON("/Home/GetSomeData", { oldData: "" }, function (data) {
$.each(data, function (i, item) {
var t = $("#listitem").tmpl(item);
$(cl).append(t);
});
});
Everything works ok under IIS express, however When I deploy the app to a freshly setup iis7 on win2k8 r2, the getJSON call fails with the error "Not Found" being displayed via the ajaxError function. (the actual app runs ok otherwise).
I can actually call the action from the browser by typing it in - http://webservername/myapp/Home/GetSomeData - and it returns the json to me.
Is this a configuration error? Or am I not supposed to be doing it like this?
TIA.