UpdatePanel 似乎与 AsynPostBack 一样难以处理大量数据。 jSonSerializer maxLength 没有帮助

发布于 2024-07-08 01:02:09 字数 573 浏览 6 评论 0 原文

我有一个 ASP.NET 3.5 应用程序并尝试更新具有嵌套自定义控件的更新面板。 在该自定义控件中有一个 ComponentArt Gird,在此更新中,它被几乎 13MB 的数据填充(是的,我可以将其分块...)。

我在更新面板中有一个隐藏按钮,当我需要 updatePanel 和网格时,我通过 JS 从客户端触发该按钮。

当我在 asyncPostback 期间使用 Updatepanelxyz.Update() 调用 Update 方法时,我稍后会在该过程中收到 asyncPostBackError 消息,指出 JSonSerializer 无法处理这么大的数据量。 我应该增加指定值。

的确。 明白了。 但是,当我在 web.config 中更改此值时,它只能工作到大约 8MB,但不能更多。 在这种情况下,JSonSerializer 是否有限制? 我已将该值设置为 Int32 的最大值,该值是默认值的 1000 倍,这对于 4MB 的序列化数据来说已经足够了。

有什么建议么? 有什么方法可以强制序列化器实现这一点吗? 有什么方法可以使用另一个序列化器吗?

干杯, 史蒂夫

I have a ASP.NET 3.5 App and trying to update a Update Panel which has a nested custom control. In that custom control is a ComponentArt Gird, which gets filled by almost 13MB of Data (Yes, I could chunck that...) at this Update.

I have a hidden button wihtin the update Panel, which I trigger by JS from client side, when I need the updatePanel and the grid.

When I call the Update method during the asyncPostback with Updatepanelxyz.Update() then I get later in the process a asyncPostBackError saying, that the JSonSerializer can't hanlde this amount of data. I should increase the specified value.

Indeed. Understood. But when I change this value in the web.config, then it does only work until round about 8MB, but not more. Is there a limit for the JSonSerializer in that case. I've set the value to the maximum value of Int32, which is kind of the 1000x of the default value, which is already enough for 4MB of serialized data.

Any suggestions? Any way to force the serializer to make that happen? Any way to use another Serializer?

Cheers,
Steve

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

时光清浅 2024-07-15 01:02:09

老兄,1 mb 的数据太多了 - 为什么你需要 13 mb?

我真的认为你需要重构你的用户界面。 我不在乎你的网络有多快,这太疯狂了!

Dude, 1 mb of data is too much - why the heck do you need 13?

I really think you need to refactor your ui. I dont care how fast your network is, that is just crazy stuff!

始终不够爱げ你 2024-07-15 01:02:09

最好的办法是更改 web.config 部分中的 ScriptingJsonSerializationSection.MaxJsonLength 属性。

它默认为 102400 个字符,而 JsonSerializer 类的限制为 2097152 个字符。

请参阅:

JsonSerializer 类 maxJsonLength 属性

JsonSerialization 配置节最大长度属性

正如我上面提到的,不幸的是,更改配置节属性是唯一的方法。

Your best bet is to change the ScriptingJsonSerializationSection.MaxJsonLength Property in your web.config section.

It defaults to 102400 characters, in contrast to the JsonSerializer class' limit of 2097152 characters.

See:

JsonSerializer class maxJsonLength property

and

JsonSerialization configuration section max length property

As I mentioned above, changing the configuration section property is the only way to go unfortunately.

埋情葬爱 2024-07-15 01:02:09

我绝对同意 UI 和数据访问层需要重构,但短期内我只是在寻找一个简单而快速的解决方案来帮助我的客户,直到软件的下一次更新发布。

I agree absolutely the UI and DataAccess layer need a refactor, but for a short-term I was just looking for a simple and quick solution to help my client until the next update of the software comes out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文