UpdatePanel in an IFrame

Last post 11-03-2006 9:01 AM by tnederveld. 3 replies.

Sort Posts:

  • UpdatePanel in an IFrame

    11-02-2006, 1:30 PM
    • Loading...
    • tnederveld
    • Joined on 11-02-2006, 11:38 AM
    • Posts 3

    I have an ASPX page that has a ScriptManager, an UpdatePanel, a Listbox inside the UpdatePanel, and a IFrame outside of the UpdatePanel. In the IFrame I have another ASPX page that has a ScriptManager, an UpdatePanel, and a Button inside the UpdatePanel. The button in the second ASPX page is not firing when clicked. I do however notice a quick flash with the Listbox of the first page.

     Any ideas why the button is not firing? 

  • Re: UpdatePanel in an IFrame

    11-02-2006, 6:18 PM
    • Loading...
    • jodywbcb
    • Joined on 03-12-2003, 3:52 PM
    • West Seattle,WA
    • Posts 985
    I have a scenario which is almost as what you have - and do not have those issues... if this is like a shared control scenario are you properly declaring the target ?  Please provide some source code and if you are using code behind that as well....(if it maniupulates the target for frames...)
    -- jody
    My Blogs on .Net 2.0 and Ajax
    http://csk.wbcb.com
    http://ArtbyJody.com
  • Re: UpdatePanel in an IFrame

    11-03-2006, 8:49 AM
    • Loading...
    • tnederveld
    • Joined on 11-02-2006, 11:38 AM
    • Posts 3

    MainPage.ASPX:

    <head runat="server">

       <script type="text/javascript">

          function LoadComp(lid){

             try {

                mainPanel.LoadThisComp(lid);

             }catch(err){

                alert("Please wait for the adjustments screen to finsh loading");

                return false;

             }

          }

       </script>

    </head>

     

    ... body tag and some other tables ... 

    <table id="tblLayout" width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">

       <tr height="100%">

          <td width="215" valign="top" style="width: 215px; height: 100%; background-color: White;" class="SplitterPane" align="center">

             <table border="0" id="tComparables" width="215" height="100%" style="height: 100%; overflow: scroll;">

                <tr height="25"><td class="TopItem">Comparables List</td></tr>

                <tr id="trComparables">

                   <td valign="top">

                      <asp:ScriptManager ID="sM" runat="server" EnablePartialRendering="true" />

                      <asp:UpdatePanel ID="uP" runat="server">

                         <ContentTemplate>

                            <asp:PlaceHolder ID="CompListHolder" runat="server" EnableViewState="False">

                               <fluent:ListTransfer ID="lOrder" runat="server" ListControlTo="lComparables" ListControlFrom="lbHide"

                                   EnableClientSide="True" AllowDuplicates="False" />

                               <asp:ListBox ID="lComparables" runat="server" Width="215px" Height="100%" EnableViewState="False"

                                   onchange="LoadComp(this.options[selectedIndex].value)" />

                               <asp:ListBox ID="lbHide" runat="server" Height="0px" Width="0px" Visible="False" EnableViewState="False" />

                            </asp:PlaceHolder>

                            <asp:HiddenField ID="hAddListing" runat="server" />

                            <asp:HiddenField ID="hDelListing" runat="server" />

                            <asp:Button ID="bAddListing" runat="server" Text="" style="display:none;" OnClick="bAddListing_Click" />

                            <asp:Button ID="bDelListing" runat="server" Text="" style="display:none;" OnClick="bDelListing_Click" />

                         </ContentTemplate>

                      </asp:UpdatePanel>

                   </td>

                </tr>

             </table>

          </td>

          <td class="HorizontalSplitterBar" style="width: 5px; vertical-align: middle; text-align: center;">

             <div style="height: 1px; width: 5px"></div>

          </td>

          <td width="100%" class="DetailsPane" valign="top" style="height: 100%;">

             <div style="width: 100%; height: 100%; overflow: auto;">

                <iframe id="mainPanel" name="mainPanel" frameborder="0" width="100%" height="100%" scrolling="auto" src=""></iframe>

             </div>

          </td>

       </tr>

    </table>

     

     

    The page for the IFrame (Page2.ASPX) gets loaded via Javascript when the MainPage.ASPX is finished loading.

    <head runat="server">

       <script type="text/javascript" language="javascript">

        function LoadThisComp(lid){

            if(IsNumeric(lid)==true){

                document.getElementById("hCompToLoad").value = lid;

                document.getElementById("bLoadComp").click();

            }

        }

        function IsNumeric(sText) {

           var ValidChars = "0123456789";

           var Char;

           for(i = 0; i < sText.length; i++) {

               Char = sText.charAt(i);

               if(ValidChars.indexOf(Char) == -1){

                  return false;

               }

            }

           return true;

        }

        </script>

    </head>

     

    ... body tags and other tables ... 

     

    <asp:ScriptManager ID="sM" runat="server" EnablePartialRendering="true" />

       <asp:UpdatePanel ID="uP" runat="server">

          <ContentTemplate>

              ... table with a bunch of labels and numeric textboxes ...

              <asp:HiddenField ID="hCompToLoad" runat="server" />

              <asp:Button ID="bLoadComp" runat="server" onClick="bLoadComp_Click" Text="" Style="display: none;" />

          </ContentTemplate>

       </asp:UpdatePanel>

    </asp:ScriptManager>

     

     

    Code-Behind:

     

    Protected Sub bLoadComp_Click(ByVal sender As Object, ByVal e As System.EventArgs)

       Dim ListingID As Integer

       If IsNumeric(hCompToLoad.Value) Then ListingID = CInt(hCompToLoad.Value)

       If ListingID > 0 Then

          PopulateFields(ListingID)

       End If

    End Sub

     
  • Re: UpdatePanel in an IFrame

    11-03-2006, 9:01 AM
    • Loading...
    • tnederveld
    • Joined on 11-02-2006, 11:38 AM
    • Posts 3
    tnederveld:

    The page for the IFrame (Page2.ASPX) gets loaded via Javascript when the MainPage.ASPX is finished loading.

     

    <asp:ScriptManager ID="sM" runat="server" EnablePartialRendering="true" />

       <asp:UpdatePanel ID="uP" runat="server">

          <ContentTemplate>

              ... table with a bunch of labels and numeric textboxes ...

              <asp:HiddenField ID="hCompToLoad" runat="server" />

              <asp:Button ID="bLoadComp" runat="server" onClick="bLoadComp_Click" Text="" Style="display: none;" />

          </ContentTemplate>

       </asp:UpdatePanel>

    </asp:ScriptManager>

     

     

    I was wrong, the ScriptManager ID is "smAdjust" and the UpdatePanel ID is "upAdjust".

Page 1 of 1 (4 items)
Microsoft Communities
Page view counter