[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2013-06-26
6
Medium Priority
?
282 Views
Last Modified: 2013-07-03
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.
0
Comment
Question by:jazz__man
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 41

Expert Comment

by:Kyle Abrahams
ID: 39278782
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
 
LVL 2

Author Comment

by:jazz__man
ID: 39278831
In Javascript
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 39278945
are you using runat=server for your controls within usercontrol?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 41

Accepted Solution

by:
Kyle Abrahams earned 2000 total points
ID: 39279033
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
 
LVL 2

Author Comment

by:jazz__man
ID: 39283841
adilkhan

Yes
0
 
LVL 41

Expert Comment

by:Kyle Abrahams
ID: 39291001
Did you try assignign a var for each text box using the usercontrol.FindControl?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question