更改viewstate的名称 [英] Changing name of viewstate
问题描述
我在同一个页面上有两个ASP.NET表单.我遇到了一些问题,因为下面的隐藏字段具有相同的名称和ID.
I have two ASP.NET form living in the same page. I some problems because the hidden fields below get the same name and id.
我可以通过某种方式更改其中一种形式的表格吗?(它们也不是用于验证的最佳方法.)
Is there some way I can change these for one of the forms? (They are also not optimal for validation).
我需要viewstate提供的服务,但是也许我可以在窗体级别禁用它,并在较低的(控制)级别使用它?
I need the services the viewstate provides, but perhaps I could disable it on form level, and use it at a lower (control) level?
推荐答案
这不是您想听到的,但是在ASP.Net中,每页只应有一个 runat ="server"
形式.否则,这只是您将遇到的许多其他问题中的第一个.
It's not what you want to hear, but in ASP.Net you should only have one runat="server"
form per page. Otherwise this is just the first of many other problems you will encounter.
这篇关于更改viewstate的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!