Close Modal Popup OnClick

Hello, I am using a ajax ModalPopupExtender.  I was wondering how i can hide the modal popup if a user clicks outside the panel (in the grayed out area around the panel).  I have a button on the page which will hide the popup when it is clicked.  How can I call the buttons click event when a user clicks outside the popup using java script?

Who is Participating?
Juan_BarreraConnect With a Mentor Commented:
In that case, I think you'd be better off using PopupControl extender, rather than ModalPopup.
It will, automatically, close when the user clicks outside the window.
grogo21Author Commented:
thanks for the link but I need to close the popup when someone clicks outside of it.  How can i determing when a user clicked outside of the popup so that I can close the popup using javascript provided on that link.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.