function D() {
var cks = document.getElementsByTagName("input");
var a = new Array();
for (var i = 0; i < cks.length; i++) {
if (cks[i].type == "checkbox" && cks[i].checked) {
a.unshift(cks[i].title);
}
}
$.ajax({
type: "get",
dataType: "text",
url: "../controller/Delete_message.ashx",
data: {"MeeageId":a},
beforeSend: function() { $("#HeadDiv").text("Send...").show("slow") },
complete: function() { $("#HeadDiv").text("Send end...").hide("slow"); },
success: function(msg) {
alert(msg);
}
})
}
后台代码:
context.Response.Write( context.Request.Params["MessageId"])
这样获取是空值 怎么办哦?
首先你要确定a在传过去的时候是有值的
传值方式如下:
data:{"MessageId":a.join(",")}
Request.QueryString["MessageId"]
data:{MessageId:a.toString()}
虽然你是个坟,挖一下吧,使用AJAX的traditional:true选项