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

Page in RadWindow loads twice

1 Answer 171 Views
Window
This is a migrated thread and some comments may be shown as answers.
Danny Scheelings
Top achievements
Rank 1
Danny Scheelings asked on 25 Mar 2010, 09:32 PM
Hi,

I think I have found a bug in the 2009 Q2 and Q3 versions. See below the code example:

<telerik:RadWindow ID="win" runat="server" ReloadOnShow="true" /> 
<asp:HyperLink runat="server" ID="hl" Text="Click" NavigateUrl="javascript:var w=OpenWin();" /> 
 
<script type="text/javascript">  
    function OpenWin()  
    {  
        var w = $find("win");  
        w.setUrl('/Default.aspx');  
        w.add_close(WinResult);  
        w.show();  
    }  
 
    function WinResult(sender, args)  
    {  
        alert("OK!");  
        //Remove window closed handler  
        sender.remove_close(WinResult);  
    }  
</script> 
 

When I click the hyperlink, the Window is opened with the URL '/Default.aspx'. When the Window is closed the WinResult javascript function is called.

The problem is that the Default.aspx page is loaded twice in the RadWindow. When I remove the RadWindow property ReloadOnShow ór when I remove the last line the from  the javascript function WinResult "sender.remove_close(WinResult)", this problem does not occur.

From one of the Telerik experts I heard that it is actually necessary to call that remove_close method on the RadWindow object to prevent executing the script more than once. So, what can I do to prevent loading the Default.aspx page twice in the RadWindow.

Thanks,
Danny

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 26 Mar 2010, 11:30 AM
Hi Danny,

When ReloadOnShow is set to true, the page inside RadWindow will always be reloaded when you show that window - this is expected behavior.


All the best,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Window
Asked by
Danny Scheelings
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or