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 ?
ThanksPeter
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');}
I reviewed message and found "BLOCKED SCRIPT", which probably was created by filter used for our forums. That nice replacement destroyed my suggestion. So, I will type that content letter by letter with spaces, maybe that will trick filter replacement
ContentUrl=" j a v a s c r i p t : ' ' "