Detect click events outside div inside usercontrol
- by toraan
I have a div inside a user control that is displayed by the user after some event.
I want to hide this div when user clicks anywhere elese on the page but not on the div (or not on any element that is inside the div).
If it wasn't a user control I could use body's clieck event to check the target,
but because this is usercontrol that is hosted by other page I can't just "play" with it's elements.
How can I achieve that without using body of the hosting page?