views:

502

answers:

2

In an asp.net web application, I have a modal popup built with a Telerik Rad Window. In that popup there is a button which must do some action in its "code-behind" and then redirect the application to another page.

For the redirection I use the javascript command 'top.document.location.href = myPage' (sent to the browser from the code-behind with a ScriptManager.RegisterClientScriptBlock(...)).

This solves my problem but it is not very nice. When the button is pressed, this triggers the post-back. In the browser the popup is covered by a RadLoadingPanel which disapper when the post-back is finished. Then during a few seconds, nothing happens in the application and it is only after some time that the browser loads the new page.

The fact that nothing happens during a few second is not great since a user cannot know what the application is doing.

What can I do ? Is there a better way to do the redirection ? (I'm very new to javascript programming...).

A: 

Maybe you'd better ask it in the Telerik support forums (www.telerik.com/forums) or using their support system, as they have an excellent support system in place.

Martin de Ruiter
+2  A: 

Instead of just calling 'top.document.location.href = myPage', you can call a function that displays an overlay (e.g. show a RadAjaxLoadingPanel over the parent page body) and then set the new URL. See http://www.telerik.com/help/aspnet-ajax/ajxshowhideloadingpanel.html for info on how to show loading panels with JavaScript.

I think the delay after you set location.href is normal - the browser/server take some time to retrieve the new page HTML so the old page cannot go away instantly.

lingvomir
Thanks ! That's what I'm trying to do. That's should be the solution.
Thierry