English 中文(简体)
ASP.NET 窗体可能过长, 无法被服务器读取
原标题:ASP.NET form may be too long, not getting read by our server

我们有一个巨大的网格, 我们有复选框和相同的文本框。

我们正经历着怪异的行为, 一个例子是底部的按钮 确实导致后退, 但步步调试显示, 事件处理者没有被调用。

所以我们把按钮移到页面的顶部 现在事件处理者被调用。

我们还注意到,在同一请求中,如果我们在顶部检查一些项目,在底部检查一些项目,顶部项目确实得到更新,底部项目没有更新。

因此,我们这样做了

        string strReturn = "";
        foreach (string strKey in Request.Form.AllKeys)
        {

            if (strKey.IndexOf(".x", 1) < 1 && strKey.IndexOf(".y", 1) < 1)
                strReturn += "<br> "  + strKey + " : " + Request.Form[strKey];
        }
        Response.Write(strReturn);

这是打印了全部格式变量, 结果显示有一个截断点 。 在查看源头时, 我们可以看到格式元素( 文本框、 复选框) 正确, 当提交时, 我们的代码没有看到这些元素 。 因此在某些时候, 请求被缩短, 它会影响窗体元素, 包括我们上面讨论过的按钮 。

We did disable viewstate for the grid and it still didn t work. We also have this in our web config file to maximize the request size, we used this for file upload too httpRuntime maxRequestLength="2097151" executionTimeout="300000000000"

我们知道我们的代码已经循环了足够多的时间 但是我们得到的值是无效的 因为请求中并不存在这些值。

这是用一台开发机操作的,但生产服务器或另一台开发机不使用。

如有任何帮助,将不胜感激。

提前感谢。

最佳回答

我很可能你再次遇到一个问题, 由最新消息所描述的这里引起的问题。

Microsoft security update MS11-100 limits the maximum number of form keys, files, and JSON members to 1000 in an HTTP request.

如果您可以通过调用缩小网格的大小, 这可能消除/ 减轻问题。 否则, 您可以增加您网络的最大值。 config

<configuration>
  <appSettings>
    <add key="aspnet:MaxHttpCollectionKeys" value="1000" />
  </appSettings>
</configuration>

更多信息 < a href=>""http://support.microsoft.com/kb/2661403" rel="no follow">这里。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签