Unique IDs not yielded by INamingContainer

D

DanWeaver

I have a user control named tabletuc

Partial Class tabletuc
Inherits System.Web.UI.UserControl
Implements System.Web.UI.INamingContainer
End Class

It is referred to as so:

DEFAULT (main page) HTML

<!-- Tablet_1 -->
<div id="1" class="tablet" style="background-image: url(images/
backgrounds/darkgrey.png)">
<uc1:tabletuc ID="tabletuc1" runat="server" />
</div>

<!-- Tablet_2 -->
<div id="2" class="tablet" style="background-image: url(images/
backgrounds/darkgrey.png)">
<uc1:tabletuc ID="tabletuc2" runat="server" />
</div>

As you can see from the web user control definition above, I have
implemented INamingContainer
in the user control (and I have tried putting this code in the default
aspx page too (and instead)) yet
I get matching ids for unique usercontrols' child controls as shown
below-

GENERATED SOURCE CODE

<!-- Tablet_1 -->
<div id="1"....
<input id="Text1" ....
<img id="Img1" ....

<!-- Tablet_2 -->
<div id="2"....
<input id="Text1" ....
<img id="Img1" ....

(the input and img child controls have the same id).
Within the page I would like every control to have a unique ID,
not just unique within a div or user control.

What am I doing wrong? How can I fix it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top