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
310
Can't set the ContentUrl (Client Side)
posted

Hi all

I can't set the Content URL of a WebDialogWindow !

Setting the Url in Design time works, but I need to change the Url during RunTime.

I use this Function

        function spiderSelected(spiderJobID) {
            //  alert(spiderJobID);

            var dialog = $find('<%=dlgDetails.ClientID%>');

            if (!dialog)
                return;

            dialog.show();

            var cp = dialog.get_contentPane();

            cp.set_contentUrl('../Secure/SpiderDetails.aspx?ID=' + spiderJobID);

            dialog._header.setCaptionText("Details");

        }

The WebDialog is Defined like this

                <ig:WebDialogWindow ID="dlgDetails" runat="server" Height="300px" InitialLocation="Centered"
                    StyleSetName="RubberBlack" Width="400px" Modal="True" WindowState="Hidden">
                    <Resizer Enabled="True" />
                </ig:WebDialogWindow>

 

Any Idea what's wrong here ?

 

Thanks
Peter

Parents
No Data
Reply
  • 24497
    Suggested Answer
    posted

    Hi Peter,

    The <iframe> for ContentPane is created on server and only if value of ContentUrl is set. So, if ContentUrl is not set, then set_contentUrl(url) will have effect only after a postback.

    I suggest to use a blank value on server. Something like

    <ig:WebDialogWindow ID="WebDialogWindow1" runat="server" Width="300px" Height="300px">
     <ContentPane ContentUrl="BLOCKED SCRIPT''"></ContentPane>
    </ig:WebDialogWindow>

    Note: it is also possible to create <iframe> on client, but it requires more work and may have side effects.

    function showDialog()
    {
     var dialog = $find('<%=WebDialogWindow1.ClientID%>');
     var cp = dialog.get_contentPane();
     var iframe = cp.get_iframe();
     if(!iframe)
     {
      iframe = document.createElement('IFRAME');
      iframe.frameBorder = 0;
      iframe.style.width = iframe.style.height = '100%';
      cp.getBody().appendChild(iframe);
     }
     cp.set_contentUrl('MyTargetUrl.aspx');
    }

Children