RadControls version |
All AJAX versions
|
.NET version |
All versions
|
Visual Studio version |
All versions
|
programming language |
.aspx
|
browser support |
all browsers supported by RadControls
|
PROJECT DESCRIPTION
Have you used code like that shown in
RadWindow as Controls Container demo?
Have you noticed that if your window has focus and the user presses Esc that the window closes? If you've written the page in such a way that you expect the window always to be open, you'll have found, as I did, that you have to reload the page to get the window back as you'll have prolly not included a control to open the thing.
With the addition of a simple JS function, you can stop the window from being closed.
When using a RadWindow like this, I generally hide the Titlebar and set Behavious="None". In addition to this, include the OnClientBeforeClose attribute and, in the called JS function, simply cancel the close request like so:
This approach means that you can have other windows on the page that will close on Esc if that's what you want.
So that's it. It's a simple solution to a question that seems to crop up a lot in the forums, one that, in an ideal world wouldn't be required 'cos the boys and girls at
telerik towers would have found a way of building in a block for the Esc key if the user wanted it.
--
Stuart