javascript - Failed to load resource: the server responded with a status of 500 using Ajax -
i knew question asked . cannot find out exact problem code.please me sort out issue
function viewcalldetails(obj) { alert("clicked"); var id = $(obj).attr("id"); $(".style-table-tab input[type='text']").val(''); settimeout(function () { $('.preloader-circle').show();// or fade, css display you'd like. }, 1000); $.ajax({ type: 'post', url: pageurl+"/loadcalldetails", data: '{leadid: "' + id + '"}', contenttype: "application/json; charset=utf-8", datatype: 'json', success: onvaluecall, failure: function (response) { alert(response.d); } }); } function onvaluecall(response) { $(".preloader-circle").hide(); $("#ctl00_contentplaceholder1_lbrfullname").text(response.d.firstname); $("#ctl00_contentplaceholder1_lbrphonenumber").text(response.d.mobileno); $("#ctl00_contentplaceholder1_lbraddress").text(response.d.address1); $("#ctl00_contentplaceholder1_lbrorganization").text(response.d.organizationname); $("#ctl00_contentplaceholder1_lblremail").text(response.d.primaryemail); }
web method:
public static userajax3 loadcalldetails(string leadid) { //system.threading.thread.sleep(3000); userajax3 ouserajax = new userajax3(); //bd_commonemail[] ocall = bd_commonemail.getemailall(convert.toint32(leadid)).toarray(); bd_leads[] ocall = bd_leads.getcalldetails(convert.toint32(leadid)).toarray(); if (ocall.length == 1) { // ouserajax.leadid = oleads.leadid.tostring(); ouserajax.leadid = ocall[0].leadid.tostring(); ouserajax.firstname = ocall[0].firstname; ouserajax.mobileno = ocall[0].mobileno; ouserajax.organizationname = ocall[0].organizationname; ouserajax.address1 = ocall[0].address1; ouserajax.primaryemail = ocall[0].primaryemail; } return ouserajax;
there many things in question:
- where "pageurl" comes from?
- you're awaiting json result, method seems return normal object. convert json?
- did try running debugger in single-step mode trhough web method?
- why web method static?
Comments
Post a Comment