ILoveJackDaniels
New member
- Joined
- Jan 2, 2007
- Messages
- 4
- Programming Experience
- 5-10
Hi all. Sorry my first post is a request begging for help, but me and my team are stumped.
We're using custom user controls in our web sites. This is to allow us to dynamically build pages based on database information.
When including a custom user control on a page, any web control with a runat="server" attribute has the ID renamed at runtime to include a prefix such as "ct101_". For example:
becomes
These changes do not seem to be consistent and between us we can't work out how to stop this happening. Our best guess is that this is .NET's way of preventing accidental use of duplicate element IDs.
We're using custom user controls in our web sites. This is to allow us to dynamically build pages based on database information.
When including a custom user control on a page, any web control with a runat="server" attribute has the ID renamed at runtime to include a prefix such as "ct101_". For example:
VB.NET:
<div id="divContent" runat="server">some content</div>
becomes
VB.NET:
<div id="ct101_divContent">some content</div>
These changes do not seem to be consistent and between us we can't work out how to stop this happening. Our best guess is that this is .NET's way of preventing accidental use of duplicate element IDs.