Forcing parent page postback

Discussion in 'ASP .Net' started by Ashish, Apr 5, 2004.

  1. Ashish

    Ashish Guest

    Hello All,
    This is a bit wierd. I have a main page in my webapp that has toolbar to
    carry out some common operations. Also this main page has an iframe that
    hosts a page that serves as an introductory page for carrying out common
    actions. When a user clicks on the links in the intro page, I want the main
    window (i.e. the main page that hosts the iframe) to perform a postback. Any
    ideas how this can be accomplished ?
    Thanks
    Ashish
     
    Ashish, Apr 5, 2004
    #1
    1. Advertising

  2. Ashish

    matt Guest

    you need to use JavaScript :

    To postback the form on the "host" page use

    top.document.forms[0].submit();

    If you want to perform a postback operation passing specific data you
    might find that using the __doPostBack JavaScript function will provide
    more what you need.

    hth

    Matt

    "Ashish" <> wrote in message
    news:%...
    > Hello All,
    > This is a bit wierd. I have a main page in my webapp that has toolbar

    to
    > carry out some common operations. Also this main page has an iframe

    that
    > hosts a page that serves as an introductory page for carrying out

    common
    > actions. When a user clicks on the links in the intro page, I want the

    main
    > window (i.e. the main page that hosts the iframe) to perform a

    postback. Any
    > ideas how this can be accomplished ?
    > Thanks
    > Ashish
    >
    >
     
    matt, Apr 5, 2004
    #2
    1. Advertising

  3. Hi Ashish,

    I agree with Matt that you can do this via a javascript code snippet. For
    example:
    If we can a page which contain a iframe as below:
    <iframe id="frmSub" src="inner.aspx" />

    then, in the "inner.aspx", we can use the following javascript code to make
    the parent(container) page be posted back:

    window.parent.document.forms[0].submit();
    or
    window.parent.document.FormName.submit();

    Either is ok. However, one thing should be noticed is that when call such
    code to make the parent page be posted back, when the parent page is posted
    back and refreshed, the iframe inner page will also be refreshed. Thanks.


    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
     
    Steven Cheng[MSFT], Apr 6, 2004
    #3
  4. Hi Ashish,

    Have you had a chance to check out the suggestions in my last reply or have
    you got any further ideas on this issue? If you have anything unclear or if
    there're anything else we can help, please feel free to post here. Thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
     
    Steven Cheng[MSFT], Apr 8, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Earl Teigrob
    Replies:
    0
    Views:
    420
    Earl Teigrob
    Aug 11, 2003
  2. John Morgan

    Forcing a page to postback

    John Morgan, Jan 22, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    497
    John Morgan
    Jan 22, 2007
  3. Mukul Gandhi
    Replies:
    0
    Views:
    519
    Mukul Gandhi
    Oct 3, 2008
  4. Martin Honnen
    Replies:
    0
    Views:
    386
    Martin Honnen
    Oct 3, 2008
  5. Sonnich

    forcing parent window to reload

    Sonnich, Nov 16, 2006, in forum: Javascript
    Replies:
    2
    Views:
    129
    Sonnich
    Nov 16, 2006
Loading...

Share This Page