opening RadWindow from dynamically created button in Master

4 posts, 0 answers
  1. David
    David avatar
    38 posts
    Member since:
    May 2013

    Posted 15 Jul 2013 Link to this post

    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
  2. David
    David avatar
    38 posts
    Member since:
    May 2013

    Posted 15 Jul 2013 Link to this post

    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! :)
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David avatar
    38 posts
    Member since:
    May 2013

    Posted 15 Jul 2013 Link to this post

    the vb.net code is on the aspx page, not the Master page.
  5. David
    David avatar
    38 posts
    Member since:
    May 2013

    Posted 15 Jul 2013 Link to this post

    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.


Back to Top