1
During development the function below finds the Control and makes the request correctly, but after publishing on the server the function no longer finds the Controller:
During the development I have to leave it like this:
url: "/Controller/Action",
When I go up to the server I have to change it and leave it like this:
url: "/MeuSite/Controller/Action",
function carregaComboEmpresa() {
$.ajax({
//url: "/MeuSite/Controller/Action",
url: "/Controller/Action",
type: "post",
dataType: "json",
contentType: "application/json; charset=utf-8",
processData: false,
data: null,
success: function (data) {
},
error: function (result) {
}
});
};
OK @LINK worked thanks, but a small fix is the syntax '@Url.Action("Action","Controller")'
– hard123
True, @Front Thanks for warning.
– Jéf Bueno