Click here to Skip to main content
15,902,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want close modal popup on esc key press

i used master page and place one modal popup on master page
and 3 modelpopup on client page which inherit the same master page

please help me to close modal popup in esc key press

1 solution

In Keypress event of that popup check the below key

if(e.KeyChar == (char)27)
    yourpopup.visible = false;
Share this answer
nktjain 25-Feb-12 2:33am    
where i have to place this code on master page, or client page
Aniket Yadav 25-Feb-12 3:23am    
have you called the same popup on the master page and on client page?
If so then do it in master page. and if not then do it in both master and client page.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900