Sunday, March 11, 2012

ModalPopup and Tabs

You can attach a javascript function to the OnClientClick event of the button

<asp:Button id="myCloseButton" Text="Close" runat="server" OnClientClick="closeModal(); return false;" />

here is the javascript:

<script language="javascript">

function closeModal(){

$find("ModalPopupExtender1").hide();

}

</script>

The parameter in the $find is the CLIENT ID of the modalpopupextender. If you are not using master pages and the mpe is not in a template container object then the client id will be the same as the value you put in the ID parameter of the mpe. If it is in a master page or a template container object then you will need to get the client id of the modal by either getting in the code behind page (useing ModalPopupExtender1.ClientID) or view the page source and get it that way.

Let me know if this helps

-Alan


Hi ,

Please refer to this link on how to do the same

http://blogs.msdn.com/phaniraj/archive/2007/02/20/show-and-hide-modalpopupextender-from-javascript.aspx

Hope this helps!

No comments:

Post a Comment