This is an updated version of the earlier (and very popular) Atlas article
It is by far the simplest way to launch an Ajax ModalPopupExtender from javascript.
The groundworks
Add a hidden link for ModalPopup Extender to attach to(which will NEVER be used)
<a href="#" style="display:none;visibility:hidden;"
onclick="return false" ID="dummyLink" runat="server">dummy</a>
Add the ID of the hidden link to the ModalPopupExtender
<ajaxToolkit:ModalPopupExtender ID="MyMPE" runat="server"
TargetControlID="dummyLink"
PopupControlID="EditorPanel"
BackgroundCssClass="modalBackground"
DropShadow="true"
BehaviourID="MyMPE"
OkControlID="OkButton"
CancelControlID="CancelButton">
</ajaxToolkit:ModalPopupExtender>
Showing the modal popup
Now you've done this, in Javascript, you can display the modal quite easily... here's how.
$find('MyMPE').show();
Hiding the modal popup
Just as easy...
$find('MyMPE').hide();
| Author |
: Paul Hayman |
| Published |
: Tuesday, 10 July, 2007 |
Paul is the COO of kwiboo ltd consultant and has more than a decade of IT consultancy experience. He has consulted for a number of blue chip companies and has been exposed to the folowing sectors: Utilities, Telecommunications, Insurance, Media, Investment Banking, Leisure, Legal, CRM, Pharmaceuticals, Interactive Gaming, Mobile Communications, Online Services.
Paul is the COO and co-founder of kwiboo (http://www.kwiboo.com/) and is also the creator of GeekZilla.