Hi,
I think I have found a bug in the 2009 Q2 and Q3 versions. See below the code example:
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
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