簡體   English   中英

jQuery將數組數據發布到asp.net頁:在頁面加載事件時無法檢索數組

[英]Jquery post array data to asp.net page: Not able to retrieve the array at page load event

使用jQuery ajax發布,我將數組變量發布到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"];
    }
}

檢查請求變量的計數。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM