I have an ajax call that has been working fine on a hosted website until recently
Defined like this
$.ajax({
url: 'GetItemsForCountry',
type: 'GET',
data: "country=" + country,
success: function (items) {
$("#Items").empty();
$("#Items").attr("disabled", false)
$.each(items, function (i, c) {
$("#Items").append($('<option></option>').val(c.Value).html(c.Text))
}
);
})
When I try and debug it locally in VS it’s working fine and I see it passing my controller on the line…
http://localhost:9000/Home/GetItemsForCountry?country=USA
when I run it with it on the hosted server, it is being passed as
http://servername/GetItemsForCountry?country=USA.
It wasn’t doing this before.
Does anyone have a clue why? or know a way to MapRoute it to make this not give a 404 error?
Thanks for any help.
David
If you change the URL to
/home/getitemsforcountryit will work on the server and locally. Just usingGetitemsforcountrywill attempt to tack that onto the current “area” of the site you are in.