how to pass parameter and reload from iframe to ascx page in updatepanel.

Last post 04-29-2008 2:27 PM by chaumette@gmail.com. 2 replies.

Sort Posts:

  • how to pass parameter and reload from iframe to ascx page in updatepanel.

    10-12-2007, 5:18 AM
    • Member
      4 point Member
    • pkay
    • Member since 09-28-2007, 2:44 PM
    • Posts 15

    hi every one,

    how to pass parameter and reload from iframe to ascx page in updatepanel.

    ----------------------------------------------------------------------------- 

    1.When i click one link menu, i would like to reload ascx page in updatepanel  from aspx inside Iframe page. it is called iframe to updatepanel. If you can, please sample code and sample link for me.

    2.When i click one link a menu in my ascx inside updatepanel page. i want to get postback value in same updatepanel.

      eg.(Reload A.ascx to A.ascx)

     ---------------------------------------------------------------------------

    1 - i would like to pass parament and reload from iframe to other updatepanel ascx

    2. - postback dynamic value in one updatepanel, for example when i click "remove" menu inside ascx page

        <upd id=updatepanel1 >

               <ascx> <a onclick=(...)> remove</a> </ascx>

        <upd>

    thanks

    pkay

     

  • Re: how to pass parameter and reload from iframe to ascx page in updatepanel.

    10-15-2007, 5:15 AM
    Answer

    Hi,

    Here, A good simple example foe you:

    For more information,see Page Access within IFrame using Ajax. & Passing events between frames

    When the user clicks on a button on Page B, You need to force an 'update panel' on Page A to do a postback (so it can refresh). 

    You can hide a button in page A, and set it to be a trigger of the updatepanel, then you can access to the button by using "window.parent.document.getElementById('Button1')" in page B.

    Try the following codes,it works great:

    Page A

    <%@ Page Language="C#" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">

        protected void Button1_Click(object sender, EventArgs e)
        {
            Label1.Text = DateTime.Now.ToString();
        }
    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                            <div style="visibility:hidden"><asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" UseSubmitBehavior="false" /></div>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <iframe src="Default13.aspx" mce_src="Default13.aspx"></iframe>
            </div>
        </form>
    </body>
    </html>

    Page B

    <%@ Page Language="C#" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">

    </script>

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <input type="button" onclick="javascript:window.parent.document.getElementById('Button1').click();" name="Button1" value="Button" id="Button1" /></div>
        </form>
    </body>
    </html>

    Let me know if you need more info.

    If this help you,don't forget mark it as a answer.Thanks!

    Best Regards,

    Sincerely,
    Jin-Yu Yin
    Microsoft Online Community Support
  • Re: how to pass parameter and reload from iframe to ascx page in updatepanel.

    04-29-2008, 2:27 PM

    In this example you have a button in child window that forces a button click in the parent window?

    Using a scenario with the iframe inside a panel with a modal extender opening/closing it:

    How would you pass a value (from the child window) to the label text (in the parent)? 

    How would  u close the child window after the value is passed to the parent? 

Page 1 of 1 (3 items)