c# - $.getJSON is not calling call back function -
call in not being called.
function gettrainingresults(id,callback){ $.getjson("/dashboard/gettrainingresults/", {'id':id}, callback); } gettrainingresults('id',function(result){ alert(result); }); and code behind
public actionresult gettrainingresults(int id) { string test = "you there."; return json(test, jsonrequestbehavior.allowget); } or suggest , way. task in call controller method , wait method response in javascript.
thanks
if use jquery.ajax, you'll @ least able see error being returned server:
function gettrainingresults(id, callback) { $.ajax({ url: "/dashboard/gettrainingresults/", data: {id: id}, success: function(data) { callback(data); }, error: function(jqxhr, textstatus, errorthrown) { console.log(errorthrown); callback(errorthrown); } }); }
Comments
Post a Comment