jquery ajax 没有反应 asp.net 4.0,jQuery的AJAX-C#成功的功能,但没有任何反应

POST http://localhost:1148/WebSite2/frmMain.aspx/webDelete 200 OK 15ms

jQuery代码是:

$.ajax({

url: "frmMain.aspx/webDelete",

type: "POST",

dataType: "text",

contentType:"text/plain",

data: {id:"abc"},

success: function(data){alert("success");alert(data)},

error: function(){alert("failed");}

});

然后两个警报在成功功能被解雇但第二次提醒为空

服务器端编码:

[WebMethod][ScriptMethod]

public static string webDelete(string id)

{

HttpContext context = HttpContext.Current;

context.Response.ContentType = "text/plain";

return id;

}

目前正在努力没有参数的时受累,误差函数是triggeres,没有成功

jQuery代码

$.ajax({

url: "frmMain.aspx/webDelete",

type: "POST",

dataType: "json",

contentType: "application/json; charset=utf-8",

data: "{}",

async: true,

success: function(data){alert("success");alert(data.d) },

error: function(){alert("failed"); }

});

服务器代码

[WebMethod][ScriptMethod]

public static string webDelete()

{

return "hello";

}

萤火虫信息:

响应头

Cache-Control private

Connection Close

Content-Length 11732

Content-Type text/html; charset=utf-8

Date Thu, 18 Jul 2013 09:47:34 GMT

Server ASP.NET Development Server/8.0.0.0

X-AspNet-Version 2.0.50727

请求头

Accept application/json, text/javascript, */*; q=0.01

Accept-Encoding gzip, deflate

Accept-Language en-US,en;q=0.5

Content-Length 2

Content-Type application/json; charset=utf-8

Host localhost:1148

Referer http://localhost:1148/WebSite2/frmMain.aspx

User-Agent Mozilla/5.0 (Windows NT 5.2; rv:22.0) Gecko/20100101 Firefox/22.0

X-Requested-With XMLHttpRequest

2013-07-16

rps

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值