Re: [问题] 请问Exception相关问题(ashx 搭配jQuery)

楼主: brocker (dinotw)   2016-02-05 12:17:56
※ 引述《valda (valda)》之铭言:
: ashx code
: try
: {
: XXXXXXX
: context.Response.Write(JsonConvert.SerializeObject(dt));
: }
: catch (Exception ex)
: {
: context.Response.Write(ex.ToString());
: }
: jQuery
: $.ajax({
: type: "post",
: url: "XXXX.ashx",
: data: 'StartMonth=' + $("#txtStartMonth").val() + "&EndMonth=" +
: $("#txtEndMonth").val(),
: success: function (response, status, xhr) {
: ParseCTMData(response);
: },
: error: function (xhr, status, error) {
: console.log('xhr
作者: johnny9144 (Johnny)   2016-02-28 09:44:00
会掉到success其实根本来说应该是要回到你的.ashx这支程式,因为他一定有回传结果给client,才会触发success ,建议先用console 把success 第一个参数印出来看看到底收到了什么东西

Links booklink

Contact Us: admin [ a t ] ucptt.com