Gary King

Gary King

  • NA
  • 83
  • 209.2k

Finding ModalPopupExtender with Code Behind (c#)

Oct 17 2011 10:42 AM
OK, so I have 3 different ModalPopupExtenders on my page, each with their own Panel.
The Panels all have a Cancel button.

When the user clicks on the Cancel button I want to execute a code behind function. I dont want to use the MPE CancelControlID as this only hides the modal popup and the OnClick of the Cancel button does not get called.

So, what I want to do is have a Cancel button with OnClick="CancelClicked"

Amongst other things, I want the CancelClicked function to hide the associated modal popup. How can I do this without explicitly naming the modal popup (because the function can be called from any of the 3 modals). I'm assuming that the object sender needs to be used, but how?

Thanks

Answers (4)