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

opening RadWindow from dynamically created button in Master

3 Answers 48 Views
Window
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 15 Jul 2013, 02:09 PM
i am trying to get a scenario working and am unable to.
THe following works

<asp:Content ContentPlaceHolderID="phContent" runat="server"><br>
<br>
<br>
 <br>
     <script type="text/javascript"><br>
<br>
         function openPOW() {<br>
<br>
             var win2 = $find('ctl00_phContent_winPOW')<br>
             win2.show();<br>
             <br>
        }<br>
<div><br>
</div>
</script><br>
<br>
<br>
        <asp:ScriptManager runat="server"></asp:ScriptManager><br>
        <telerik:RadWindow Behaviors="Maximize,Minimize,Close" Modal="true" AutoSize="true" ID="winPOW" runat="server" Skin="Sitefinity"><br>
            <ContentTemplate><br>
                <iframe style="width:750px;height:450px;" src="../orders/PredictiveOrderDeliveryDates.aspx" id="myframePOW"></iframe><br>
                <br>
                <br>
            </ContentTemplate><br>
        </telerik:RadWindow><br>
  <br>
<input type="button" id="opPOW" onclick="openPOW()" /><br>
</asp:Content>






the following will result in the page refreshing but no RadWindow appearing.
Note that i am having to fill my 'win' variable slightly differently from above, as to do it like above would result in the win variable returning a 'null' value.



<br>
<br>
<br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;"><asp:Content ContentPlaceHolderID="phContent" runat="server"></font><br style="font-size: 14.399999618530273px;">
<br style="font-size: 14.399999618530273px;">
<br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;"> </font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">     <script type="text/javascript"></font><br style="font-size: 14.399999618530273px;">
<br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">         function openPOW() {</font><br style="font-size: 14.399999618530273px;">
<br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">               var win = $('ctl00_phContent_winPOW');</font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">             win.show();</font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">             </font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">        }</font><br style="font-size: 14.399999618530273px;">
<div style="font-size: 14.399999618530273px;"><br>
</div>
<font style="font-size: 14.399999618530273px;"></script></font><br style="font-size: 14.399999618530273px;">
<br style="font-size: 14.399999618530273px;">
<br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">        <asp:ScriptManager runat="server"></asp:ScriptManager></font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">        <telerik:RadWindow Behaviors="Maximize,Minimize,Close" Modal="true" AutoSize="true" ID="winPOW" runat="server" Skin="Sitefinity"></font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">            <ContentTemplate></font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">                <iframe style="width:750px;height:450px;" src="../orders/PredictiveOrderDeliveryDates.aspx" id="myframePOW"></iframe></font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">                </font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">                </font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">            </ContentTemplate></font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">        </telerik:RadWindow></font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">  </font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;"><input type="button" id="opPOW" onclick="openPOW()" /></font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;"></asp:Content></font><br style="font-size: 14.399999618530273px;">
<br>


<br>
<br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">          Dim lnkPredictiveOrderWizard As New LinkButton</font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">            With lnkPredictiveOrderWizard</font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">                .Text = "Use Predictive Wizard"</font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">                .ToolTip = "Use a wizard to create order"</font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">                .CssClass = "menubar_wizard"</font><br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">                .ID = "lnkPredictiveOrderWizard"</font><br style="font-size: 14.399999618530273px;">
<br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">                AddHandler .Click, AddressOf PredictiveWizard</font><br style="font-size: 14.399999618530273px;">
<br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">            End With</font><br style="font-size: 14.399999618530273px;">
<br style="font-size: 14.399999618530273px;">
<font style="font-size: 14.399999618530273px;">            _master.Menubar.Add(lnkPredictiveOrderWizard)</font><br>
<br>
<br>
<br>
 Public Sub PredictiveWizard(ByVal sender As Object, ByVal e As EventArgs)<br>
  Dim jscript As String = "javascript:openPOW();"<br>
<br>
Page.ClientScript.RegisterStartupScript(Me.GetType(), "key", jscript, True)<br>
end sub

3 Answers, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
answered on 15 Jul 2013, 02:14 PM
for some reason the 'Format Code Block' has added loads of extra rubbish about fonts, on my post. i can't seem to easily remove it but it is not part of my original code - in case you were wondering! :)
0
David
Top achievements
Rank 1
answered on 15 Jul 2013, 02:20 PM
the vb.net code is on the aspx page, not the Master page.
0
David
Top achievements
Rank 1
answered on 15 Jul 2013, 02:29 PM
i've spent all day on this. then 10 minutes after i post it here, i get the answer! thats always the way!

anyway, my answer was to add the following into the codebehind on page load:

winPOW.OpenerElementID = "ctl00_comxMenuBar_lnkPredictiveOrderWizard"

winPOW is the RadWindow
ctl00_comxMenuBar_lnkPredictiveOrderWizard is the hardcoded full ClientID that i expect my dynamically created button to have.


Tags
Window
Asked by
David
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Share this question
or