Hi there,
What you're trying to do is not possible. You can't create dynamic IDs when creating controls with declarative syntax.
What you could do is create the controls in code (in your Code Behind page, or in a method in code in your ASPX page). You can assign IDs to the controls and then add them to the page, like this:
Code:
Label myLabel = null;
for (int i = 0; i < 10; i++)
{
myLabel = new Label();
myLabel.ID = "lbl" + i.ToString();
myLabel.Text = "Label " + i.ToString();
this.Controls.Add(myLabel);
}
This will add a bunch of Labels to the page, each with a different, dynamically generated ID.
What exactly are you trying to accomplish? The code I posted here will get you into troubles when you try to access these controls and their values again because they no longer exist.
If you need repeating controls, take a look at the the asp:Repeater control. It's designed to repeat data and allows for nested controls.
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.