jquery:$.ajax() 简单 例子

function CoursewareOffShelf(o) {
alert(o.id);
$.ajax(
{
type: "post",
url: "AjaxCoursewareOffShelf.aspx",
data: {
"ApplicationId": o.id,
"ApplicationTypeId":2
},
success: function (data, textStatus)
{
var j = eval(data);
$.each(j, function (i, item) {
var count = item.count;
if (count > 0) {
var _mkingCount = $('#<%=lbShelfed.ClientID %>').html();
var _mkingCurrentCount = (_mkingCount - 1);
$('#<%=lbShelfed.ClientID %>').html(_mkingCurrentCount);
divShelfed_click();

}
else {
alert("课件下架申请失败!");
}

})
},
complete: function (XMLHttpRequest, textStatus)
{
//HileLoading();
},
error: function () {
//alert("请求出错");
}
});


}

AjaxCoursewareOffShelf.aspx:
Response.ContentType ="application/json";
int count = -1;
string ApplicationId = (Request["ApplicationId"] == null || Request["ApplicationId"] == "") ? null : Request["ApplicationId"];
string ApplicationTypeId = (Request["ApplicationTypeId"] == null || Request["ApplicationTypeId"] == "") ? null : Request["ApplicationTypeId"];
if (ApplicationTypeId != null && ApplicationId != null)
{
int _applicationId = Convert.ToInt32(ApplicationId);
int _applicationTypeId = Convert.ToInt32(ApplicationTypeId);
EProductApplicationBLL ebl = new EProductApplicationBLL();
count=ebl.OffShelfApplication(_applicationId, _applicationTypeId);


}
Response.Write("[{ \"count\":\"" + count.ToString() + "\"}]");
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值