jquery - page method not working -


i'm calling page method using jquery function that's 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 code behind file, have:

[webmethod] public static void resetdate(datetime thenewdate) {     var test = 4; } 

however, when put breakpoint on var test = 4, never stops there.

what missing?

thanks.

you need check happening jquery call - suggest using firebug (or equivalent in browser of choice) trace javascript , see response/request.

this allow see errors being returned web page/method.


update:

you should sending proper json if use datatype: "json".


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -