title: JavaScript conflict in ASP.NET web control
body: <p>folks.
  I have searched in google for answers for my question, but all I could found was solutions about unique IDs of the generated HTML elements of asp.net web contros. <strong>But that's not what I'm looking for.</strong> What I need is a way to program the javascript of my web control in a way that it does not conflict when there are multiple instances of it in the same page.
  For example, consider the following simple user control, wiche has a text box and a button, and that when the user clicks the button it shows an alert with the value of the thext box:</p>
  
  <p>
  </p>
  
  <p>Now imagine we have two or more instances of such user contol. How can I make sure that the javascript will show the message of the proper text box, since their IDs will be generated dynamically and will be all be all different of each other? I know how to discover these IDs at runtime, that's not a problem. But the problem is how to program the user control so that the javascrip references only the elements of the instance to wich it makes part, just like the button in my simple user control example. If there are ten user controls, then it will be ten buttons, and of course ten text boxes. The simple alert message here begins to became a bit not very simple, I think.</p>
  
  <p>But maybe it's really simple, I just don't know how. Thanks anyone who can help me with this.</p>