tags:

views:

74

answers:

1

Hi,

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

+1  A: 

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.

Joop
You are true.the origin of the issue is dynamically generated tables(right now 3) added on a place holder.The header row of each table has a hidden control.
swapna
Then you should give the dynamically generated tables an unique ID in some way. Glad I could help you out.
Joop
Actually ther is a logic written for craeting uniquid's but somehow duplication of the tables happens in the code.Actually only one table should exist. Thanks a lot.your answer help me to ponder and reach out to the problem.
swapna
Good to know. Please mark my answer as accepted :)
Joop