I have a weird issue.
When I use Ajax to call a function in an aspx.cs file, the Ajax sends the request in the wrong aspx file even if I ask another file. In fact, every time I try it call the aspx.cs file of the first page.
this is my ajax :
$.ajax({
type: "POST",
url: "NewLayerPage.aspx/getData2",
data: dataToSend,
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function (data) {
console.log(dataToSend);
console.log("data sended");
},
failure: function (response) {
alert(response.d);
}
});
When I use that code in a function, it is looking for "getData2" in "FirstPage.aspx.cs" instead of "NewLayerPage.aspx.cs". I'm sure my function in NewLayer work because when I copy/paste it in FirstPage I have no issue. This is my error :
Any ideas ? Thanks for all !
EDIT : So when I comment the function in "firstPage" I got an error as you can see here :
But if I do not comment the function I do not have an error: