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