Open pop up, close pop up and reload parent (ignoring the postback)

Last post 03-07-2007 8:14 PM by XOR_. 1 replies.

Sort Posts:

  • Open pop up, close pop up and reload parent (ignoring the postback)

    03-07-2007, 4:59 PM

    Hi,

     I have a script to open a pop up window following a postback and have got this window automatically closing after 5 seconds and refreshing the parent page using the following javascript:

    Page.ClientScript.RegisterStartupScript(

    this.GetType(), "QuickAddPopUpClose", "setTimeout('window.opener.parent.location.reload();window.close()', 5000);", true);

    However this causes the parent window to be reloaded as if the form has been submitted again, so the pop up is opened again. Does anyone if it's possible to do this?

    Thanks.

  • Re: Open pop up, close pop up and reload parent (ignoring the postback)

    03-07-2007, 8:14 PM
    Answer
    • Loading...
    • XOR_
    • Joined on 02-08-2007, 9:35 PM
    • Posts 110

    Page.ClientScript.RegisterStartupScript(

    this.GetType(), "QuickAddPopUpClose", "setTimeout('window.opener.parent.location=window.opener.parent.location + '?t=1';window.close()', 5000);", true);

    note that i just add some useless junk on the end to tell the browser that the location has actually changed, so reload the page.... you may want to ensure that the quotes are all in the right places though.... 

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