Sincerely, -- S. Justin Gengo, MCP Web Developer Free code library at: www.aboutfortunate.com "Out of chaos comes order." Nietzche "Isabel" wrote in message news:google.com...[ref] > How can you close all child browser windows that where open by a > parent browser window? I have links on a parent (main) page that > opens the child page as a separate browser. However, I need to be > able to close all the opened child browser pages from the parent page. > > Thank you for your help, > > Isabel[/ref] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => <1f71a545.0308250710.79dd6ea8@posting.google.com> [htmlstate] => on_nl2br [postusername] => S. [ip] => sjgengo@aboutfo [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> Close all child windows - ASP.NET General

Close all child windows - ASP.NET General

How can you close all child browser windows that where open by a parent browser window? I have links on a parent (main) page that opens the child page as a separate browser. However, I need to be able to close all the opened child browser pages from the parent page. Thank you for your help, Isabel...

  1. #1

    Default Close all child windows

    How can you close all child browser windows that where open by a
    parent browser window? I have links on a parent (main) page that
    opens the child page as a separate browser. However, I need to be
    able to close all the opened child browser pages from the parent page.

    Thank you for your help,

    Isabel
    Isabel Guest

  2. #2

    Default Re: Close all child windows

    Isabel,

    If it's just a single window close it via it's name.

    window.[window name].close()

    If you have multiple child windows open use an array:

    <script language="JavaScript">
    <!--
    openWins = new Array();
    curWin = 0;

    function openWin(page) { openWins[curWin++] = window.open(page,'_blank'); }

    function closeAll() {
    for(i=0; i<openWins.length; i++) if (openWins[i] && !openWins[i].closed)
    openWins[i].close();
    }
    //-->
    </script>

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "Isabel" <com> wrote in message
    news:google.com... 


    S. Guest

  3. #3

    Default Re: Close all child windows

    Hi Isabel,

    1. In the JavaScript window.open() method, assign the return value to a
    variable that represents the child window.
    2. Make sure that no PostBacks occur in the parent window prior to
    attempting to close the child windows. Otherwise, the child window variables
    will be lost (they are client-side, and specific to the instance of an HTML
    doent that launched them)
    3. Use the child window variables created in the JavaScript window.open()
    method to close the child windows.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    The more I learn, the less I know.

    "Isabel" <com> wrote in message
    news:google.com... 


    Kevin Guest

  4. #4

    Default Re: Close all child windows

    Afraid not. Once the parent window is reposted, there is no connection
    between parent and children. Each child window would have to close itself.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    The more I learn, the less I know.

    "Isabel" <com> wrote in message
    news:google.com... 
    news:<phx.gbl>... [/ref]
    variables [/ref]
    HTML [/ref]
    window.open() [/ref][/ref]


    Kevin Guest

Similar Threads

  1. Close Windows Extention
    By balewis1 in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 4
    Last Post: December 11th, 07:52 PM
  2. close a running swf child
    By Bob in forum Macromedia Flash
    Replies: 3
    Last Post: June 22nd, 12:23 PM
  3. close all browser windows?
    By Chris in forum Dreamweaver AppDev
    Replies: 0
    Last Post: February 23rd, 09:36 PM
  4. can't close windows
    By Rat Garton in forum Windows XP/2000/ME
    Replies: 14
    Last Post: July 11th, 03:52 AM
  5. Child window close/session problem
    By Xing Rong in forum ASP
    Replies: 0
    Last Post: June 30th, 06:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •