ajax dictionary,jquery - Ajax post dictionary with comma separated value - Stack Overflow

在发送Ajax请求时,遇到了一个问题:字典`selectedKeys`中的`bu_keys`和`be_keys`字符串被截断,仅获取到了第一个部分。尝试了`Download`和`DownLoad2`两个控制器方法,但都无法获取完整的字符串。问题可能出在数据转换或传递过程中。解决方案可能涉及正确解析以逗号分隔的字符串或者使用合适的数据格式进行传递。
摘要由CSDN通过智能技术生成

I have a dictionary as follow

var selectedKeys = {

"bu": bu_keys,

"be": be_keys,

}

The bu_keys , be_keys each has a string separated with comma.

Example:

possible value for bu_keys is: "12354,abccsd,dsdfdlk,d35487"

when i send this to my controller i got only the first part of the string which is 12354

$.ajax({

url: "@Url.Action("Download", "Reports")",

dataType: "json",

type: "POST",

data: { allKeys: selectedKeys },

success: function (selectedKeys) {

//do nothing

},

error: function (xhr, status, error) {

alert("Error: Please refresh the page and try again!" + status + " " + error + " " + xhr.status + " " + xhr.statusText);

}

});

public FileResult DownLoad(Dictionary allKeys)

{

// code here

}

public FileResult DownLoad2(Dictionary allKeys)

{

// code here

}

How can i get all the string not only the first part of the string, i tried both actions Download and DownLoad2, with no success

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值