Monday, March 26, 2012

Trigger Modal Popup from clientside JavaScript

Hi!

How can I trigger a Modal Popup from client-side JavaScript, without having to have it triggered off of a LinkButton server control?

The modal popup demo on the Sample website shows how to show/hide the popup in script.


Would you believe I must have looked at that page dozens and dozens of times and never noticed that blurb down below?Embarrassed

I must admit that one of the problems is that the documentation on the page makes no reference to the BehaviorID property of the ModalPopupExtender... I only found it through extensive Googling...


That blurb was just added last week after we received more than a couple of requests for demo'ing how to programmatically show/hide modalpopups.

Regarding your question about BehaviorID, it is not ModalPopup specific but something that is part of the Toolkit ExtenderControlBase class so all the extenders in the Toolkit have it. You can find more information on that in theExtender Base Class features walkthrough on the Toolkit sample website.


Aaah! Whew! Now I don't feel so bad :)

And thanks for the pointer on the BehaviorID stuff... I think in my haste to see what the toolkit had to offer I didn't dig deep enough to find out about the extras. Just what I needed!

No comments:

Post a Comment