Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
25
Changing ContentUrl of ContentPane on close
posted

I have a page with several links, and clicking some of them will open up a WebDialogWindow which contains an iFrame.

However, if I click link "a", closed the WebDialogWindow, then click link "b", I initially see the ASPX page that was the result from clikcing link "a", until the ASPX page that should be displayed after clicking link "b" takes over, i.e. when the browser received HTML to display.

Is there a way to set the ContentUrl of the ContentPane back to "about:blank" (or another URL) when the user closes the WebDialogWindow? This probably needs to be done on the client side.

Parents
  • 24497
    Verified Answer
    posted

    Hi,

    There is set_contentUrl(url) property of content pane. So, you may process dialog-closed event and change url to any desired value. Below is example with a test button.

    <ig:WebDialogWindow ID="WebDialogWindow1" runat="server" Width="300px" Height="300px">
     <ClientEvents WindowStateChanged="stateChanged" />
     <ContentPane ContentUrl="MyTargetUrl.aspx">
     </ContentPane>
    </ig:WebDialogWindow>

    <script type="text/javascript">
    function stateChanged(dialog, evtArgs)
    {
     if(dialog.get_windowState() == $IG.DialogWindowState.Hidden)
      dialog.get_contentPane().set_contentUrl('BLOCKED SCRIPT""');
    }
    function showDialog()
    {
     var dialog = $find('<%=WebDialogWindow1.ClientID%>');
     dialog.set_windowState($IG.DialogWindowState.Normal);
    }
    </script>
    <input type="button" value="show dialog" onclick="showDialog()" />

Reply Children
No Data