请求在移动设备上太长。

huangapple go评论56阅读模式
英文:

The request its too long on mobile

问题

我正在开发一个基于ASP.NET的Web应用程序,在移动设备上进行一些测试时,当我发送完成的表单时,出现“无法显示页面,因为请求太长”的消息。

在桌面上尝试时,这个问题不会出现,问题只会在移动设备上出现。我尝试了谷歌浏览器和Microsoft Edge,但没有任何区别。

在寻找这条消息的起源时,我发现这是一个内存问题。我尝试了一些解决方案,比如在web.config中配置<serverRuntime>,但显然不起作用。此外,我在IIS服务器上对<requestlimits>进行了一些配置,但也没有起作用。需要注意的是,我一次发送4到16张图像以及一些其他纯文本信息。

英文:

hi i'm developing a web app on asp.net and i'm making some testing on mobile devices and i'm getting the message "it cannot show the page due the request it's too long" when i send my completed form.
请求在移动设备上太长。

making tries on desktop this problem doesn't appears, the problem it´s just appearing in mobile devices, i tried on google chrome and Microsoft edge but there's no difference.

looking around for the origin of this message i found that it's a memory problem, i tried some solutions like &lt;serverRuntime&gt; configuration in the web.config but apparently it doesn't work, inclusive i made some configuration on &lt;requestlimits&gt; on the iis server and it does't work neither for some more information i send between 4 and 16 images at onece in addition of some other plain text info.

答案1

得分: 0

你是否大量使用 ViewState?您可以考虑禁用 ViewState,比如对于 GridView 或其他类型的数据绑定控件(或将 ViewState 的内容移至基于 session() 的方式)。

另一点要注意的是如何显示图片。

如果您正在流式传输图片(base64)?那么当用户点击按钮时,所有这些图片都会被发送回服务器。这通常会导致负载过大的问题。

因此,如果有图片,请使用图像控件;如果正在流式传输图片作为 xbase64 图片,则需要创建并采用图像处理程序。

所以,没有更多详细信息,我们都一头雾水,但对 ViewState 的大小多关注一下可能会解决这个问题。

英文:

Are you making heavy use of viewstate? You could consider disable of viewstate say for a girdview, or other types of data bound controls. (or move viewstate stuff to session() based)

Another thing to look at is how you displaying the images.

If your are streaming the images (base64)? Then when the user hits a button, then ALL OF those images are posted back to the server. This can often result in a payload that is too large.

So, if you have images, then use a image control, and if you streaming the images as xbase64 images, then you need to create + adopt a image handler.

So, without more details, we all are in the dark, but giving some love and care to the size of viewstate may well fix this issue for you.

huangapple
  • 本文由 发表于 2023年5月14日 01:08:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76243996.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定