I know there are simulated messages, but I did not find any help in any of them.
My web methods work when I do not use URL rewriting, but as soon as I turn it on, stop working.
JQuery
$.ajax({
type: "POST",
url: "index.aspx/SaveSetting",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
console.log(msg);
}
});
WITH#
[WebMethod()]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public static string SaveSetting()
{
return "OK";
}
When this is called, I get the full HTML address of my page and do not say "OK." I started the debugger and saw that when I call the web method, it runs Page_Load on my page, and not in the web method.
So, I got the corerct path, but the web method is not being called.
I am using C #, jQuery, ASP.NET 3.5.
Any help?
source
share