javascript - Sending JSON jQuery to ASHX - Success Callback not Triggering -
i sending data form via jquery ajax json formatted data. file processing on server ashx handler.
below - code snippet:
// jquery ajax json ... $.ajax({ type: "post", url: "handler.ashx", data: $.tojson(formdata), datatype: "json", contenttype: "application/json; charset=utf-8", success: function(response) { $('#ajax-loader').hide(); $('#msg').html("ok!"); }, error: function(response) { $('#ajax-loader').hide(); $('#msg').html("error!"); } });
// handler.ashx... public void processrequest(httpcontext context) { context.response.contenttype = "text/plain"; string json = requestbody(context.request); javascriptserializer js = new javascriptserializer(); formdata formdata = js.deserialize<formdata>(json); // business process ... // ... context.response.write("ok - right"); }
however, jquery performs error instead of success callback function, if server worked. can happening?
success callback not triggering. adjustments recommend?
obs: status ok 200 - firebug response.
Comments
Post a Comment