Keep controls in usercontrol unique so that they do not interfere with each other on same form

How do I keep controls in usercontrol unique so that they do not interfere with each other on same form.

I have a countdown label for a multiline textbox within a usercontrol and want to have two of them on my form.

The problem is when I enter text into one box the counter on the other is being changed because the id of the labels must be the same in each instance of the usercontrol.

Would be grateful for some ideas round this one.
LVL 2
jazz__manAsked:
Who is Participating?
 
Kyle AbrahamsConnect With a Mentor Senior .Net DeveloperCommented:
http://forums.asp.net/t/1379140.aspx/1

Set a var for each textbox
use the UserControl's instantation (eg: Control1 vs Control2) to find the textbox in question, and you can then update independantly.
0
 
Kyle AbrahamsSenior .Net DeveloperCommented:
How are you performing the update to the label?

If you do UserControl1.FindControl("theTextbox") you should only ever get that instance's textbox back.
0
 
jazz__manAuthor Commented:
In Javascript
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Saqib KhanSenior DeveloperCommented:
are you using runat=server for your controls within usercontrol?
0
 
jazz__manAuthor Commented:
adilkhan

Yes
0
 
Kyle AbrahamsSenior .Net DeveloperCommented:
Did you try assignign a var for each text box using the usercontrol.FindControl?
0
All Courses

From novice to tech pro — start learning today.