为什么不为QUOT; renderAllHiddenFieldsAtTopOfForm"不工作? [英] Why isn't "renderAllHiddenFieldsAtTopOfForm" not working?

查看:290
本文介绍了为什么不为QUOT; renderAllHiddenFieldsAtTopOfForm"不工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个.NET 4的Web应用程序,我在web.config中设置属性renderAllHiddenFieldsAtTopOfForm为假。不幸的是,隐藏字段仍处于顶部。

In a .NET 4 web application I've set the property "renderAllHiddenFieldsAtTopOfForm" to "false" in the web.config. Unfortunately the hidden fields are still at the top.

这是为什么?难道其他一些设置来覆盖它?

Why is this? Does some other setting override it?

在web.config中页面属性:

"pages" property in web.config:

表格上面的截图:
IDE呢?

Screenshot of top of the form: ide it?

推荐答案

从<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.configuration.pagessection.renderallhiddenfieldsattopofform.aspx\"相对=nofollow>文档:

所有系统生成的隐藏字段
  在页面的顶部呈现。这个
  可以确保信息的
  这些字段被发送到服务器
  即使回发之前执行
  页面加载完毕。如果
  RenderAllHiddenFieldsAtTopOfForm是
  设置为false,执行回传
  之前的页面加载完毕
  可能会导致无效或回传
  回调参数的错误。

all system-generated hidden fields are rendered at the top of the page. This makes sure that the information in these fields is sent to the server even if a postback is performed before the page has finished loading. If RenderAllHiddenFieldsAtTopOfForm is set to false, performing a postback before the page has finished loading can cause an "Invalid postback or callback argument" error.

虽然属性名称指示
  所有的隐藏字段,用户自己创建
  隐藏字段不受
  此属性的设置。

Although the property name indicates "all hidden fields," user-created hidden fields are not affected by settings for this property.

我不知道你正试图在这里完成的,但它并不像你可以做你想要什么。而且,对于这个问题,我不知道这是一个好主意,即使你可以。

I'm not sure what you are attempting to accomplish here, but it doesn't look like you can do what you are wanting to. And, for that matter, I'm not sure it's a good idea even if you could.

这篇关于为什么不为QUOT; renderAllHiddenFieldsAtTopOfForm&QUOT;不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆