I would like to know why this "404 (Not Found)" error is flagging me when I try to call a WebMethod with ajax from a WebForm or aspx, now the detail is that the webform is inside a Mvc project I do not know if it has something to do
I leave the code of how I'm called from the js. Thank you very much in advance.
code js
$.ajax({
type: "POST",
data: "",
url: "../AspNetForms/WebForm1.aspx/MR_Operaciones",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(result){
alert("todo bien ");
},
error: function (result) {
alert("Algún problema debe haber…");
}
});
code in C #:
[WebMethod]
public static List<object> MR_Operaciones()
{
List<object> list = new List<object>();
try
{
return new List<object>() { "", "listaparametros", "listacontroles" };
}
catch (Exception ex)
{
return new List<object>() { ex.Message };
}
}