0
使用jQuery ajax發佈我將數組變量發佈到asp.net頁面。但我不能檢索的頁面加載事件數組變量..Jquery將數組數據發佈到asp.net頁面:無法在頁面加載事件中檢索數組
$(document).ready(function() {
var importTable = $("#dataTables-example");
var arrayOfValues = [];
$('#btnDownload').click(function() {
$('input:checkbox:checked', importTable).each(function() {
debugger;
arrayOfValues.push($(this).closest('tr').find('td:nth-child(2)').text());
}).get();
$.post('CS.aspx', { arrayOfValues: arrayOfValues }, function (data) { });
});
});
我的頁面加載事件:
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
Response.ContentType = "application/json";
string emptyStringArray = Request.Params["arrayOfValues1"];
}
}
Request.Params [「arrayOfValues」] – ssilas777
我覺得你PARAM名稱是「arrayOfValues」而不是「arrayOfValues1」 –
甚至Request.Params變化[「arrayOfValues1」]來Request.Params後,我仍然得到了emptyStringArray空值[ 「arrayOfValues」]。 –