User control ID collision
I have a user control that is loaded and added to my page through a container and the LoadControl method:
while(!done)
{
MyControl myControl = (MyControl) LoadControl("mycontrol.ascx");
placeholderContainer.Controls.Add(myControl);
}
The problem arises when I click on of the LinkButtons in my user control. ASP.NET replies with an error message saying that one or more of my server controls have the same ID.
Even though I assign a unique ID though the ID property to all my controls in the user control AND to the myControl in the example above I still get the error message.
How do asp.net assign the IDs? Especially when controls are nested and have IDs like:
TreeView$pnltreeNode$TreeNodeIcon
The line above is from my code, and I doesn't get a single match when I use the find function to search after the string "pnltreeNode" (case sensitive).
Is this a bug?
|