ajax modal popup hide

Last post 09-25-2008 11:35 AM by noirenex. 15 replies.

Sort Posts:

  • Re: ajax modal popup hide

    09-25-2008, 11:35 AM
    • Member
      34 point Member
    • noirenex
    • Member since 08-29-2008, 6:12 AM
    • Posts 11

     I arrived here trying to find out how to close a modal with the escape key as well, i found a solution so I am posting it to help others in future.

    Add this javascript to the head section of the aspx page you want to perform the event on.

    document.onkeydown = function(e){    
                        if (e == null) { // ie
                            keycode = event.keyCode;
                        } else { // mozilla
                            keycode = e.which;
                        }
                        if(keycode == Sys.UI.Key.esc){
                            $find('<%= commentsModal.ClientID %>').hide();
                        }
                    };

     

    where commentsModal is your server side ID of the extender.

Page 2 of 2 (16 items) < Previous 1 2