Thanks for the additional explanation. You are correct, the ID naming behavior seems to be different for custom usercontrols.
Here is what I did:
I created a very basic custom UserControl. I dragged the first instance of the control onto my page. The ID was set to
usercontrols_customcontrol_ascx1.
I then dragged a 2nd control onto my page. The ID was blank. I also dragged a 3rd & 4th instance of the control onto my page. All subsequent control IDs were blank.
I saved my Sitefinity page and then re-edited the page. All custom control ID's were now blank. Even my original instance of the control.
I'm not sure if this is the intend behavior or not. I did not experience any problems from having blank control ID's. I tossed some TextBoxes into my custom control to see what ID's these controls would inherit. Here is what I saw:
<div><input name="ctl00$Page_Content$ctl00$TextBox" type="text" value="Hello World" id="ctl00_Page_Content_ctl00_TextBox" /></div> |
<div><input name="ctl00$Page_Content$ctl01$TextBox" type="text" value="Hello World" id="ctl00_Page_Content_ctl01_TextBox" /></div> |
<div><input name="ctl00$Page_Content$ctl02$TextBox" type="text" value="Hello World" id="ctl00_Page_Content_ctl02_TextBox" /></div> |
Those are unique ID's. They aren't visible in Sitefinity but ASP.NET to handling this at runtime.
Again, I'm not sure this is working properly, but I did not experience any direct problems due to this behavior.
Gabe Sumner
http://www.sitefinitywatch.com/