Saturday, March 24, 2012

Modal pop-up questions

First, I'd like to display a modal pop-up programatically instead of it being triggered by a button click event or similar.

Secondly, if the user clicks OK, I'd like it to trigger a server-side function.

I've tried several approaches to doing these and have not had much success. Could anyone provide some direction?

Thanks

To show and hide the modal popup programatically:

ModalPopupExtender1.Show() and ModalPopupExtender1.Hide() ' Change "ModalPopupExtender1" to whatever yours is called.

To get your "Okay" button to fire normal server-side code, just don't specify an OkControlID for the ModalPopupExtender. Handle the button's click event normally and just use the above .Hide() method to close the popup.

No comments:

Post a Comment