Why isn't “renderAllHiddenFieldsAtTopOfForm” not working?

馋奶兔 提交于 2020-01-04 05:29:10

问题


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?

"pages" property in web.config:

Screenshot of top of the form:

ide it?

回答1:


From the docs:

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.



来源:https://stackoverflow.com/questions/3876642/why-isnt-renderallhiddenfieldsattopofform-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!