The issue that I'm having is that when I make an jQuery AJAX call to a code behind function, it simply returns the HTML from the aspx page. It doesn't matter what I put after the slash (function name), it just returns the HTML form the page.
Here's my jQuery function.
function ajaxYo() {
jQuery.ajax({
type: "POST",
url: "SalesMonitor.aspx/GetCurrentTime",
data: '{name: "Brandon" }',
dataType: "json",
success: function (response) { alert("success!"); },
failure: function (response) { alert("failure!"); }
});
It will POST successfully, but the response is just HTML from the page and I don't get an actual alert, I'm just seeing the post and response in Firebug.
My .cs code behind function:
[System.Web.Services.WebMethod]
public static string GetCurrentTime(string name)
{
return "Yes";
}