Composite Control Prob - Multiple controls with the same ID '_ctl0' were found

Composite Control Prob - Multiple controls with the same ID '_ctl0' were found

Post by wg » Fri, 14 Mar 2003 04:30:31



Hi folks,

The situation:
I have a custom ASP.NET server control that contains
multiple custom server controls.  These controls
themselves contain other standard and custom server
controls.

The problem:
When I implement the INamingContainer on the top-most
container server control, I get the error about having
multiple controls with the same ID.  When I simply
implement the INamingContainer on the contained child
controls ... it works fine.

What gives?  Can anyone explain why this is happening and
how to resolve the issue?  The primary reason that I want
to be able to use the INamingContainer at the top level
lies in the fact I may want to include it in another
custom control somewhere down the line.

Anyways, any help would be much appreciated.

Thanks - wg

 
 
 

Composite Control Prob - Multiple controls with the same ID '_ctl0' were found

Post by wg » Fri, 14 Mar 2003 07:43:27


Interestingly enough, if I remove the INamingContainer
interface from all of my server controls (those that
contain other controls as well as those that do not) ...
everything works out perfectly fine!  Viewstate, post-
back, eventhandling, etc... for each of the custom
controls works as expected.

Any ideas as to an explanation???

thanks - wg

Quote:>-----Original Message-----
>Hi folks,

>The situation:
>I have a custom ASP.NET server control that contains
>multiple custom server controls.  These controls
>themselves contain other standard and custom server
>controls.

>The problem:
>When I implement the INamingContainer on the top-most
>container server control, I get the error about having
>multiple controls with the same ID.  When I simply
>implement the INamingContainer on the contained child
>controls ... it works fine.

>What gives?  Can anyone explain why this is happening
and
>how to resolve the issue?  The primary reason that I
want
>to be able to use the INamingContainer at the top level
>lies in the fact I may want to include it in another
>custom control somewhere down the line.

>Anyways, any help would be much appreciated.

>Thanks - wg
>.