I have a user control in .NET 2010. I dragged it on to a page twice. Obviously, both have the same functions. But, depending on which instance was clicked, I want to run the function diffenetly. How can I tell which user control was clicked?
….
Let me add to this. It is a user control with a datalist in it. The data list contains numerous clickable images. When the image is clicked, I am trying to grab the name of the instance to use in the code of the user control itself.
Updated To Match Comment
The easiest way would be to use the
senderparameter in your event handler. In your case, you should be able to cast toControland then use theParentproperty to get to the actual UserControl: