I'm using the following code to close a modalPopup but for some reason is not working.
<script>
function pageLoad(sender, args){
if(!args.get_isPartialLoad()){
// add our handler to the document's
// keydown event
$addHandler(document, "keydown", onKeyDown);
}
}
function onKeyDown(e){
if(e && e.keyCode == Sys.UI.Key.esc){
// if the key pressed is the escape key, dismiss the dialog
$find('ModalPopupExtenderPanelFullViewProductos').hide();
}
}
</script>
<ajax:ModalPopupExtender ID="ModalPopupExtenderPanelFullViewProductos"
runat="server" TargetControlID="LinkButtonDummy"
BackgroundCssClass="modalBackground"
PopupControlID="PanelFullViewProductos"
X="20" Y="50" DropShadow="true"
RepositionMode="None">
</ajax:ModalPopupExtender>
You must set a BehaviorID for your modal popup extender..Then you can use
$find('BehaviorID').hide();
Please Mark as answer if it satisfies you..