Reputation: 7728
I have a enterprise application converted from VS2003 to vs2005 .
The converted application, in one page i do edit and save i am getting this error.
System.Web.HttpException: Multiple controls with the same ID 'hidWIPID0' were found. FindControl requires that controls have unique IDs.
But the same work fine in the code of vs2003 version without any error.
Its a huge application with dynamic master pages and usercontrols etc..So i cant paste the exact code here.
But the origin of the error is master page content control.
eg: page code MasterPageStrategy:Content id="pnlMain"
Error
Multiple controls with the same ID 'hidWIPID0' were found
View Source
MasterPage:pnlMain:_ctl2:hidWIPID0
I Microsoft support there is an article explaining the same issue.But it applies to 1.1 version. I have already converted code in 2.0 version and the error appears in convertd code.
http://support.microsoft.com/kb/834608
someone please look into this issue and provide me a solution as it is very urgent.
Thanks SNA
Upvotes: 1
Views: 3989
Reputation: 2839
The problem is exactly what the exception tells you. Within your masterpage / page tree there are several controls with the same ID. In .NET 2.0, and other versions, that isn't allowed.
I would suggest to search the masterpages and pages used to build the page you are requesting and rename one of the controls that have the same ID. However since you have a huge application with multiple dynamic and inherited masterpages I think you will stumble into the same problem several times.
Maybe you should switch to 4.0 version of the .NET framework? In 4.0 you can specify the 'clientIDMode'. More about this: http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientidmode.aspx
Edit While thinking about it, it doesn't make sense. When you have multiple masterpages and contentplaceholders the controls get a unique prefix. It seems to me you have a kind of repeater in one page that is causing this problem.
Upvotes: 2