ajax链接服务器失败,加载资源失败:使用Ajax响应状态为500的服务器

该博客讨论了一个JavaScript问题,其中Ajax请求返回500内部服务器错误。作者展示了用于加载资源的Ajax函数,并在失败时显示响应。在Web方法中尝试获取并返回用户数据。尽管设置了断点,但问题仍然存在,可能是由于服务器端的代码没有正确执行。
摘要由CSDN通过智能技术生成

我很清楚以前问过这个问题。但我无法找出什么是我的code.Please确切的问题帮我理清这个问题加载资源失败:使用Ajax响应状态为500的服务器

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 however 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方法:

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;

2016-11-08

Ivin Raj

+0

为什么不设置断点检查是否调用LoadCallDetails。如果不检查你的帖子的网址。 –

+0

我已经检查使用break point.But没有调用LoadcallDetails @CodeFarmer –

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值