This is a migrated thread and some comments may be shown as answers.

[Solved] MVC Window - Escape Key

3 Answers 108 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Travis
Top achievements
Rank 1
Travis asked on 06 Oct 2011, 03:29 PM
Is there a built-in property for the Window that will close it when you press the escape key. I know I could do it easily with jQuery but it'd be nicer if there was just a configuration I could set in the control itself.

3 Answers, 1 is accepted

Sort by
0
Travis
Top achievements
Rank 1
answered on 10 Oct 2011, 05:01 PM
** Crickets **
Bueller? Bueller?

Does it really take more than 4 days to answer a question around here?
0
Atanas Korchev
Telerik team
answered on 11 Oct 2011, 06:16 AM
Hi Travis,

 No, there is no built-in property which allows this. You can however easily hook up the keyup event of the window and use its close method in order to implement this requirement.

 On a side note Telerik does not guarantee replies to forum posts for Telerik Extensions for ASP.NET MVC. You can check here what the support options are.

All the best,
Atanas Korchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Max
Top achievements
Rank 1
answered on 24 Jan 2012, 10:38 PM
hey there
Did you manage to achieve this task sucessfully? I have tried the followinf but it wont work:
Thanks
document.onKeydown = function(evt) {
    evt = evt || window.event;
    if (evt.keyCode == 27) {
        alert("Escape");
    }
};
Tags
Window
Asked by
Travis
Top achievements
Rank 1
Answers by
Travis
Top achievements
Rank 1
Atanas Korchev
Telerik team
Max
Top achievements
Rank 1
Share this question
or