javascript - Ajax success call is not executing -
i have following ajax call:
$.ajax({ type: "post", url: "default.aspx/generatepdfs", data: '{frequency: "' + $('#ddlreportfrequency option:selected').text() + ', reportyear: "' + $('#txtreportyear').text() + ', reportmonth: "' + $('#txtreportmonth').text() + ', reportday: "' + $('#txtreportday').text() + ', reportoption: "' + $('#ddlreportoption option:selected').text() + ', reportregion: "' + $('#txtreportregion').text() + ', reportschedule: "' + $('#ddlreportschedule').text() + ', reportregion: "' + $('#txtreportregion').text() + '"}', contenttype: "application/json; charset=utf-8", // datatype: "json", success: function (data) { debugger; if (data.d != "") { $('#rptdisplay').text(data.d); } alert("1"); }, failure: function () { // $('#rptdisplay').text("error"); alert("2"); } i think made mistake sending parameters since success section not called.
what doing wrong here?
you try using
data: json.stringify({ frequency: $('#ddlreportfrequency option:selected').text(), ... }), not sure if have remove charset part in here.
contenttype: "application/json; charset=utf-8"
Comments
Post a Comment