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

Previous page showing in RadWindow

4 Answers 200 Views
Window
This is a migrated thread and some comments may be shown as answers.
Keith Avery
Top achievements
Rank 1
Keith Avery asked on 04 Aug 2008, 10:30 PM
I have some code similar to:

var oWnd = $find("<%=RadWindow1.ClientID%>");
oWnd.setUrl('Page1.aspx');
oWnd.show();

after window is closed, script is sometimes executed again:

var oWnd = $find("<%=RadWindow1.ClientID%>");
oWnd.setUrl('Page2.aspx');
oWnd.show();

When popup window is displayed a second time it briefly displays the contents for Page1.aspx before postback is completed and window is refreshed.

How do I avoid this?

I'd either want no contents to be shown in popup window until page has been fetched, or delay displaying popup until refresh has completed.

Did try DestroyOnClose as a way of clearing the previous results but this doesn't seem to work as $find returns null second time it is called.


Thanks
Keith

4 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 05 Aug 2008, 12:32 PM
Hi Keith,

In your case, I would suggest 2 solutions:
  1. Set ReloadOnShow to true and ShowContentDuringLoad to false.
    OR
  2. change the url of the RadWindow to a blank page when closed. e.g.:
    function OnClientClose(oWnd)
    {
      oWnd.setUrl("about:blank");
    }

I hope this helps.


Kind regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Keith Avery
Top achievements
Rank 1
answered on 05 Aug 2008, 03:25 PM
thanks
0
Jason Lee
Top achievements
Rank 1
answered on 30 Aug 2008, 06:15 AM
Dear Geogri,

Can I set "DestroyOnClose" property to true to resolve this problem?
In fact, I have done this and it doesn't work for me..

Therefore, what's "DestroyOnClose" feature about?

Morever, "ReloadOnShow" will postback to server twice.  In some scenario, it's not a good idea.
0
Georgi Tunev
Telerik team
answered on 01 Sep 2008, 07:01 AM
Hello Jason,

Yes, this would help as well. Basically, when DestroyOnClose is enabled for a RadWindow, when this window is closed its object will be destroyed and you will not be able to open it again until the whole page is reloaded. Note that in this case, it is best to either set the properties of the RadWindow in the RadWindowManager declaration, or to set them dynamically with the client-side API.




Sincerely yours,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Keith Avery
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Keith Avery
Top achievements
Rank 1
Jason Lee
Top achievements
Rank 1
Share this question
or