weixin_33694620 2017-06-22 22:37 采纳率: 0%
浏览 13

jQuery发布和缺少数据

I'm retrieving an a list of sites, groups, and users. I'm concatenating and placing them in their respective variable, sending them in a query string to an aspx file.

var url = (Page._BASE_URL + 'Mo/Un/Unis/Unifie.aspx?' + getUserSecurityParameter() +
    '&action=sending&userIds=' + encodeURI(userIds) +
    '&siteName=' + encodeURI(site) +
    '&groupName=' + encodeURI(groupName) +
    '&siteList=' + encodeURI(siteList) +
    '&team=' + encodeURI(team) +
    '&users=' + encodeURI(users)+
    '&site=' + encodeURI(site));

Ii'm using this code to retrieve those values on from the ajax post. I notice when I notice check the aspx source, There's so much data between the groups and sites that the users variable and data is never present.

var siteName = $.getUrlVar('siteName');
var groupName = $.getUrlVar('groupName');
var users= $.getUrlVar('users');

Is there a better way to do this so I won't have this issue? Because of missing users data it throws of a query that is written on the back end. Thanks in advance.

This is what I have now. When I try to send the data over I get an error. I can't see the what the error is unfortunately.

    var requestParameters =
    {
        siteList: siteList,
        team: team,
        users: users,
        siteName: site,
        site: site,
        group: group,
        userId: userId,
        securityCode: getUserSecurityParameter()
    };

$.ajax({
    url: Im._B + 'Mo/Uni/Unif/Ui.aspx/getValues',
    type: "POST",
    data: JSON.stringify(requestParameters),
    contentType: "application/json; charset=UTF-8",
    done: function (requestParameters, textStatus, jqXHR) {
        var left = Math.floor((screen.width - 545) / 2);

        windowManager.openFixed(url, 'DocumentListWindow', left, /* top: */ 10, /* width: */ 1480, /* height: */ 840);
},
    error: function (jqXHR, textStatus, errorThrown) {
    alert('An error occurred trying to send the data.');
}
});

Ui.aspx.cs

[System.Web.Services.WebMethod]
public static string getValues(string requestParameters)
{

    string mystuff = requestParameters;
    return mystuff;
}

ERROR "{\"Message\":\"Operation is not valid due to the current state of the object.\",\"StackTrace\":\"

  • 写回答

1条回答 默认 最新

  • weixin_33709590 2017-06-22 23:09
    关注

    Although there is technically no limit to the length of a query string, individual browsers do have limits. Follow Alex's advice and convert this to a post.

    评论

报告相同问题?

悬赏问题

  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗