I know there are simular posts out there, but I found no help in any of them.
My web methods work when im not using url rewriting, but as soon as I turn it on it stop working.
jQuery
$.ajax({
type: "POST",
url: "index.aspx/SaveSetting",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
console.log(msg);
}
});
C#
[WebMethod()]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public static string SaveSetting()
{
return "OK";
}
When this is called, I get the full HTML of my page back, and no "OK" message. I ran the debugger and saw that when I call the web method it triggers Page_Load in my page and not the web method.
So I got the corerct path, but the web method is not called.
I use C#, jQuery, ASP.NET 3.5.
Any help?