I’m calling a page method using a jquery function that’s somewhat like this:
function GetNewDate(thedateitem) {
ThisMonth = 3;
TheDay = 1;
TheYear = 2011;
DateString = TheMonth + '/' + TheDay + '/' + TheYear;
$.ajax({
type: "POST",
url: "/Pages/CallHistory.aspx/ResetDate",
contentType: "application/json; charset=utf-8",
data: DateString,
dataType: "json",
success: successFn,
error: errorFn
})
};
And then, in the code behind file, I have:
[WebMethod]
public static void ResetDate(DateTime TheNewDate)
{
var test = 4;
}
However, when I put a breakpoint on var test = 4, it never stops there.
What am I missing?
Thanks.
You need to check exactly what is happening with your jQuery call – I suggest using firebug (or the equivalent in your browser of choice) to trace the javascript and see the response/request.
This will allow you to see any errors being returned from the web page/method.
Update:
You should be sending proper JSON if you use
dataType: "json".