I am calling an Asp.Net C # method since a script works perfectly for me when it is in the url: 'default.aspx / NombreDelMetodo' but when I enter the project where I must implement the code I have problems with the url try these three forms but give me error
url: "@Url.Content('~/Delivery/mapGoogle.aspx/MiMetodo')"
url: "/Delivery/mapGoogle.aspx/MiMetodo",
url: "../Delivery/mapGoogle.aspx/MiMetodo",
se ejecuta en mi navegador http://localhost:55531/Delivery/mapGoogle.aspx
Micodigo
function InvocarMetodoWeb() {
$.ajax({
type: "POST",
url: "@Url.Content('~/Delivery/mapGoogle.aspx/MetodoWeb')",
data: '{name: "' + 'EFRAIN' + '" }',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
error: function (result) {
alert("Error" + result);
}
});
}
function OnSuccess(response) {
alert(response.d);
}
my file system