The most common way of having the content of the RadWindow already loaded
when you first show it
is by using is ContentTemplate. In this way the controls you put there are part of the main page and are thus loaded with it. This will allow an instant display when the RadWindow's show() method is called, yet it will increase the overall initial page load time. For lighter dialogs with static content this is perhaps the better approach, since also accessing the controls from the main page is easier that way. Please take a look a this online demo
to see how it behaves in this scenario. This is perhaps the better option for the ones with static content.
As for preloading an iframe - this is quite difficult, since if it is initially hidden (for example put in the ContentTemplate) as the browser will reload it when you show it (the RadWindow). Therefore what you can do is have the RadWindow that should be preloaded to be shown on the page when it is loaded (VisibleOnPageLoad=true) but with an offset that will place it outside of the screen, then instead of its show() method you should call its center() method (or moveTo(), depending on your needs). For example:
"open the RadWindow"
"showTheRadWindow(); return false;"
Please note that this RadWindow should not be modal, or it will block the screen. If you wish you can make it modal when you need to show it via its Client-side API
. You can also make other modifications - such as size, behaviors, position, etc.
As for preloading the data - you could do this in the pageLoad() event of the content page if you decide to use my method of preloading. This, however, will be always executed, even for RadWindow that the user never decides to show. An alternative is to call a function declared in the content page
that will do the job once the RadWindow should be shown to the user (i.e. when you call the center() method). This should be done only once the content page is loaded, though, to prevent errors. For this purpose you can raise a flag in the OnClientPageLoad event of the RadWindow.
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward!
We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>