Basic Javascript Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Fox

    Basic Javascript Question

    Hello,

    I am attempting to do something very simple. I have
    a page MainPage.aspx and a popup window Popup.aspx. When
    users click on the linkbutton in the popup window I am
    looking to do some server side processing in Popup.aspx,
    then have the popup window close, and have the
    MainPage.aspx do a postback to the server. But I am
    having trouble determining what client side javascript
    Popup.aspx should render after it does its server side
    processing. Are there any samples or articles tha
    demonstrate how to do this? I keep getting "Object
    Expected" in CloseChildWindo w():

    script.js
    -------------------------------
    var PopUp;

    // Called from MainPage.aspx
    function OpenPopup(id, mode, eid)
    {
    var url = "";
    url += "Controls/PopUp.aspx?";
    url += "FormName=" + document.forms[0].name;
    url += "&id="+ id;
    url += "&m=" + mode;
    url += "&eid="+ eid;

    var width = 250;
    var height = 150;

    var str = "";
    str += "toolbars=n o,";
    str += "status=no, ";
    str += "resizable= 0,";
    str += "scrollbars=0," ;
    str += "width=" + width + ",";
    str += "height=" + height + ",";

    if ( window.screen ) {
    var ah = screen.availHei ght - 30;
    var aw = screen.availWid th - 10;

    var xc = ( aw - width ) / 2;
    var yc = ( ah - height ) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
    }

    PopUp = window.open( url, 'EmailList', str );
    }

    function CloseChildWindo w(id, postBack)
    {
    debugger;
    PopUp.close();
    if (postBack)
    __doPostBack(id ,'');
    }

    The code I have in Popup.aspx is

    <script language="JavaS cript">
    <!--

    window.onload=w indow_onload();

    function window_onload() {
    window.opener.C loseChildWindow ('a', true);
    }

    //-->
    </script>

    Any help would be appreciated! Thanks.
  • Michael Høtoft

    #2
    Re: Basic Javascript Question

    Hi, besides from all the obvious things like domain rights, and case
    sensitiv try to look for this:

    For JavaScript to be public(seen by other programs) in IE, It has to be
    declared in the html header.


    Comment

    • Kevin Spencer

      #3
      Re: Basic Javascript Question

      If I interpret your JavaScript correctly, it looks like your script is
      supposed to close the window AFTER a PostBack. The page in the browser after
      a postback is not the same page that was in the browser BEFORE the PostBack.
      It may be the same HTML document, but the memory of the new instance is not
      the same as the memory of the old - HTTP is stateless. To the browser, it is
      a whole new page. Therefore, there is no longer a window object reference in
      memory pointing to the child window. Using the same variable name does
      nothing.

      --
      HTH,

      Kevin Spencer
      Microsoft MVP
      ..Net Developer

      Neither a follower nor a lender be.


      "Mark Fox" <info@solelsoft ware.com> wrote in message
      news:070301c362 dd$487816b0$a40 1280a@phx.gbl.. .[color=blue]
      > Hello,
      >
      > I am attempting to do something very simple. I have
      > a page MainPage.aspx and a popup window Popup.aspx. When
      > users click on the linkbutton in the popup window I am
      > looking to do some server side processing in Popup.aspx,
      > then have the popup window close, and have the
      > MainPage.aspx do a postback to the server. But I am
      > having trouble determining what client side javascript
      > Popup.aspx should render after it does its server side
      > processing. Are there any samples or articles tha
      > demonstrate how to do this? I keep getting "Object
      > Expected" in CloseChildWindo w():
      >
      > script.js
      > -------------------------------
      > var PopUp;
      >
      > // Called from MainPage.aspx
      > function OpenPopup(id, mode, eid)
      > {
      > var url = "";
      > url += "Controls/PopUp.aspx?";
      > url += "FormName=" + document.forms[0].name;
      > url += "&id="+ id;
      > url += "&m=" + mode;
      > url += "&eid="+ eid;
      >
      > var width = 250;
      > var height = 150;
      >
      > var str = "";
      > str += "toolbars=n o,";
      > str += "status=no, ";
      > str += "resizable= 0,";
      > str += "scrollbars=0," ;
      > str += "width=" + width + ",";
      > str += "height=" + height + ",";
      >
      > if ( window.screen ) {
      > var ah = screen.availHei ght - 30;
      > var aw = screen.availWid th - 10;
      >
      > var xc = ( aw - width ) / 2;
      > var yc = ( ah - height ) / 2;
      >
      > str += ",left=" + xc + ",screenX=" + xc;
      > str += ",top=" + yc + ",screenY=" + yc;
      > }
      >
      > PopUp = window.open( url, 'EmailList', str );
      > }
      >
      > function CloseChildWindo w(id, postBack)
      > {
      > debugger;
      > PopUp.close();
      > if (postBack)
      > __doPostBack(id ,'');
      > }
      >
      > The code I have in Popup.aspx is
      >
      > <script language="JavaS cript">
      > <!--
      >
      > window.onload=w indow_onload();
      >
      > function window_onload() {
      > window.opener.C loseChildWindow ('a', true);
      > }
      >
      > //-->
      > </script>
      >
      > Any help would be appreciated! Thanks.[/color]


      Comment

      • Vidar Petursson

        #4
        Re: Basic Javascript Question

        Hi

        If I get you right...

        Do the processing in the popup
        Return a script to the popup that calls some method(s) in the opener

        window.opener.d ocument.forms[0].mySubmitBtn.cl ick(); // This will click a
        submit button named mySubmitBtn
        Or call a function in parent window(opener)
        window.opener.F UNCTIONNAME();
        window.close();// Close child

        --
        Best Regards
        Vidar Petursson
        =============== ===============
        Microsoft Internet Client & Controls MVP
        =============== ===============
        "Mark Fox" <info@solelsoft ware.com> wrote in message
        news:070301c362 dd$487816b0$a40 1280a@phx.gbl.. .[color=blue]
        > Hello,
        >
        > I am attempting to do something very simple. I have
        > a page MainPage.aspx and a popup window Popup.aspx. When
        > users click on the linkbutton in the popup window I am
        > looking to do some server side processing in Popup.aspx,
        > then have the popup window close, and have the
        > MainPage.aspx do a postback to the server. But I am
        > having trouble determining what client side javascript
        > Popup.aspx should render after it does its server side
        > processing. Are there any samples or articles tha
        > demonstrate how to do this? I keep getting "Object
        > Expected" in CloseChildWindo w():
        >
        > script.js
        > -------------------------------
        > var PopUp;
        >
        > // Called from MainPage.aspx
        > function OpenPopup(id, mode, eid)
        > {
        > var url = "";
        > url += "Controls/PopUp.aspx?";
        > url += "FormName=" + document.forms[0].name;
        > url += "&id="+ id;
        > url += "&m=" + mode;
        > url += "&eid="+ eid;
        >
        > var width = 250;
        > var height = 150;
        >
        > var str = "";
        > str += "toolbars=n o,";
        > str += "status=no, ";
        > str += "resizable= 0,";
        > str += "scrollbars=0," ;
        > str += "width=" + width + ",";
        > str += "height=" + height + ",";
        >
        > if ( window.screen ) {
        > var ah = screen.availHei ght - 30;
        > var aw = screen.availWid th - 10;
        >
        > var xc = ( aw - width ) / 2;
        > var yc = ( ah - height ) / 2;
        >
        > str += ",left=" + xc + ",screenX=" + xc;
        > str += ",top=" + yc + ",screenY=" + yc;
        > }
        >
        > PopUp = window.open( url, 'EmailList', str );
        > }
        >
        > function CloseChildWindo w(id, postBack)
        > {
        > debugger;
        > PopUp.close();
        > if (postBack)
        > __doPostBack(id ,'');
        > }
        >
        > The code I have in Popup.aspx is
        >
        > <script language="JavaS cript">
        > <!--
        >
        > window.onload=w indow_onload();
        >
        > function window_onload() {
        > window.opener.C loseChildWindow ('a', true);
        > }
        >
        > //-->
        > </script>
        >
        > Any help would be appreciated! Thanks.[/color]


        Comment

        • S. Justin Gengo

          #5
          Re: Basic Javascript Question

          Mark,

          I have some code for just this at my website, www.aboutfortunate.com. Just
          search the code library for: "refresh main window" or something similar. The
          title of the sample you want is:

          Close a popup window and refresh the parent window

          Sincerely,

          --
          S. Justin Gengo, MCP
          Web Developer

          Free code library at:


          "Out of chaos comes order."
          Nietzche


          "Mark Fox" <info@solelsoft ware.com> wrote in message
          news:070301c362 dd$487816b0$a40 1280a@phx.gbl.. .[color=blue]
          > Hello,
          >
          > I am attempting to do something very simple. I have
          > a page MainPage.aspx and a popup window Popup.aspx. When
          > users click on the linkbutton in the popup window I am
          > looking to do some server side processing in Popup.aspx,
          > then have the popup window close, and have the
          > MainPage.aspx do a postback to the server. But I am
          > having trouble determining what client side javascript
          > Popup.aspx should render after it does its server side
          > processing. Are there any samples or articles tha
          > demonstrate how to do this? I keep getting "Object
          > Expected" in CloseChildWindo w():
          >
          > script.js
          > -------------------------------
          > var PopUp;
          >
          > // Called from MainPage.aspx
          > function OpenPopup(id, mode, eid)
          > {
          > var url = "";
          > url += "Controls/PopUp.aspx?";
          > url += "FormName=" + document.forms[0].name;
          > url += "&id="+ id;
          > url += "&m=" + mode;
          > url += "&eid="+ eid;
          >
          > var width = 250;
          > var height = 150;
          >
          > var str = "";
          > str += "toolbars=n o,";
          > str += "status=no, ";
          > str += "resizable= 0,";
          > str += "scrollbars=0," ;
          > str += "width=" + width + ",";
          > str += "height=" + height + ",";
          >
          > if ( window.screen ) {
          > var ah = screen.availHei ght - 30;
          > var aw = screen.availWid th - 10;
          >
          > var xc = ( aw - width ) / 2;
          > var yc = ( ah - height ) / 2;
          >
          > str += ",left=" + xc + ",screenX=" + xc;
          > str += ",top=" + yc + ",screenY=" + yc;
          > }
          >
          > PopUp = window.open( url, 'EmailList', str );
          > }
          >
          > function CloseChildWindo w(id, postBack)
          > {
          > debugger;
          > PopUp.close();
          > if (postBack)
          > __doPostBack(id ,'');
          > }
          >
          > The code I have in Popup.aspx is
          >
          > <script language="JavaS cript">
          > <!--
          >
          > window.onload=w indow_onload();
          >
          > function window_onload() {
          > window.opener.C loseChildWindow ('a', true);
          > }
          >
          > //-->
          > </script>
          >
          > Any help would be appreciated! Thanks.[/color]


          Comment

          • Mark Fox

            #6
            Re: Basic Javascript Question

            Justin,

            I downloaded the code from your site (which is very
            helpful stuff) but could not find the sample you referred
            to (I actually didn't find any samples). I also didn't
            find a search function on your site. Is the function
            you're referring to in the Javascript namespace? Where
            might I find the samples you mentioned? Thanks!
            [color=blue]
            >-----Original Message-----
            >Mark,
            >
            >I have some code for just this at my website,[/color]
            www.aboutfortunate.com. Just[color=blue]
            >search the code library for: "refresh main window" or[/color]
            something similar. The[color=blue]
            >title of the sample you want is:
            >
            >Close a popup window and refresh the parent window
            >
            >Sincerely,
            >
            >--
            >S. Justin Gengo, MCP
            >Web Developer
            >
            >Free code library at:
            >www.aboutfortunate.com
            >
            >"Out of chaos comes order."
            > Nietzche
            >
            >
            >"Mark Fox" <info@solelsoft ware.com> wrote in message
            >news:070301c36 2dd$487816b0$a4 01280a@phx.gbl. ..[color=green]
            >> Hello,
            >>
            >> I am attempting to do something very simple. I[/color][/color]
            have[color=blue][color=green]
            >> a page MainPage.aspx and a popup window Popup.aspx.[/color][/color]
            When[color=blue][color=green]
            >> users click on the linkbutton in the popup window I am
            >> looking to do some server side processing in[/color][/color]
            Popup.aspx,[color=blue][color=green]
            >> then have the popup window close, and have the
            >> MainPage.aspx do a postback to the server. But I am
            >> having trouble determining what client side javascript
            >> Popup.aspx should render after it does its server side
            >> processing. Are there any samples or articles tha
            >> demonstrate how to do this? I keep getting "Object
            >> Expected" in CloseChildWindo w():
            >>
            >> script.js
            >> -------------------------------
            >> var PopUp;
            >>
            >> // Called from MainPage.aspx
            >> function OpenPopup(id, mode, eid)
            >> {
            >> var url = "";
            >> url += "Controls/PopUp.aspx?";
            >> url += "FormName=" + document.forms[0].name;
            >> url += "&id="+ id;
            >> url += "&m=" + mode;
            >> url += "&eid="+ eid;
            >>
            >> var width = 250;
            >> var height = 150;
            >>
            >> var str = "";
            >> str += "toolbars=n o,";
            >> str += "status=no, ";
            >> str += "resizable= 0,";
            >> str += "scrollbars=0," ;
            >> str += "width=" + width + ",";
            >> str += "height=" + height + ",";
            >>
            >> if ( window.screen ) {
            >> var ah = screen.availHei ght - 30;
            >> var aw = screen.availWid th - 10;
            >>
            >> var xc = ( aw - width ) / 2;
            >> var yc = ( ah - height ) / 2;
            >>
            >> str += ",left=" + xc + ",screenX=" + xc;
            >> str += ",top=" + yc + ",screenY=" + yc;
            >> }
            >>
            >> PopUp = window.open( url, 'EmailList', str );
            >> }
            >>
            >> function CloseChildWindo w(id, postBack)
            >> {
            >> debugger;
            >> PopUp.close();
            >> if (postBack)
            >> __doPostBack(id ,'');
            >> }
            >>
            >> The code I have in Popup.aspx is
            >>
            >> <script language="JavaS cript">
            >> <!--
            >>
            >> window.onload=w indow_onload();
            >>
            >> function window_onload() {
            >> window.opener.C loseChildWindow ('a', true);
            >> }
            >>
            >> //-->
            >> </script>
            >>
            >> Any help would be appreciated! Thanks.[/color]
            >
            >
            >.
            >[/color]

            Comment

            • Mark Fox

              #7
              Re: Basic Javascript Question

              Justin,

              I downloaded the code from your site (which is very
              helpful stuff) but could not find the sample you referred
              to (I actually didn't find any samples). I also didn't
              find a search function on your site. Is the function
              you're referring to in the Javascript namespace? Where
              might I find the samples you mentioned? Thanks!
              [color=blue]
              >-----Original Message-----
              >Mark,
              >
              >I have some code for just this at my website,[/color]
              www.aboutfortunate.com. Just[color=blue]
              >search the code library for: "refresh main window" or[/color]
              something similar. The[color=blue]
              >title of the sample you want is:
              >
              >Close a popup window and refresh the parent window
              >
              >Sincerely,
              >
              >--
              >S. Justin Gengo, MCP
              >Web Developer
              >
              >Free code library at:
              >www.aboutfortunate.com
              >
              >"Out of chaos comes order."
              > Nietzche
              >
              >
              >"Mark Fox" <info@solelsoft ware.com> wrote in message
              >news:070301c36 2dd$487816b0$a4 01280a@phx.gbl. ..[color=green]
              >> Hello,
              >>
              >> I am attempting to do something very simple. I[/color][/color]
              have[color=blue][color=green]
              >> a page MainPage.aspx and a popup window Popup.aspx.[/color][/color]
              When[color=blue][color=green]
              >> users click on the linkbutton in the popup window I am
              >> looking to do some server side processing in[/color][/color]
              Popup.aspx,[color=blue][color=green]
              >> then have the popup window close, and have the
              >> MainPage.aspx do a postback to the server. But I am
              >> having trouble determining what client side javascript
              >> Popup.aspx should render after it does its server side
              >> processing. Are there any samples or articles tha
              >> demonstrate how to do this? I keep getting "Object
              >> Expected" in CloseChildWindo w():
              >>
              >> script.js
              >> -------------------------------
              >> var PopUp;
              >>
              >> // Called from MainPage.aspx
              >> function OpenPopup(id, mode, eid)
              >> {
              >> var url = "";
              >> url += "Controls/PopUp.aspx?";
              >> url += "FormName=" + document.forms[0].name;
              >> url += "&id="+ id;
              >> url += "&m=" + mode;
              >> url += "&eid="+ eid;
              >>
              >> var width = 250;
              >> var height = 150;
              >>
              >> var str = "";
              >> str += "toolbars=n o,";
              >> str += "status=no, ";
              >> str += "resizable= 0,";
              >> str += "scrollbars=0," ;
              >> str += "width=" + width + ",";
              >> str += "height=" + height + ",";
              >>
              >> if ( window.screen ) {
              >> var ah = screen.availHei ght - 30;
              >> var aw = screen.availWid th - 10;
              >>
              >> var xc = ( aw - width ) / 2;
              >> var yc = ( ah - height ) / 2;
              >>
              >> str += ",left=" + xc + ",screenX=" + xc;
              >> str += ",top=" + yc + ",screenY=" + yc;
              >> }
              >>
              >> PopUp = window.open( url, 'EmailList', str );
              >> }
              >>
              >> function CloseChildWindo w(id, postBack)
              >> {
              >> debugger;
              >> PopUp.close();
              >> if (postBack)
              >> __doPostBack(id ,'');
              >> }
              >>
              >> The code I have in Popup.aspx is
              >>
              >> <script language="JavaS cript">
              >> <!--
              >>
              >> window.onload=w indow_onload();
              >>
              >> function window_onload() {
              >> window.opener.C loseChildWindow ('a', true);
              >> }
              >>
              >> //-->
              >> </script>
              >>
              >> Any help would be appreciated! Thanks.[/color]
              >
              >
              >.
              >[/color]

              Comment

              • Kevin Spencer

                #8
                Re: Basic Javascript Question

                Hi Mark,
                [color=blue]
                > Would the child window posting back to the server cause
                > the parent-child reference variable to be lost?[/color]

                When you use the JavaScript window.open() method, the window object that
                refers to the child window is in the parent window's HTML document. If the
                parent window posts back, the reference is lost, as the parent window's
                document is unloaded. If the child window posts back, the document in the
                child window changes, and all memory in that document is lost, but as the
                reference to the child window is in the parent window's document, it isn't
                lost.

                The child window can close itself without any problems.

                --
                HTH,

                Kevin Spencer
                Microsoft MVP
                ..Net Developer

                Neither a follower nor a lender be.

                "Mark Fox" <info@solelsoft ware.com> wrote in message
                news:08ac01c365 b4$507f3b20$a00 1280a@phx.gbl.. .[color=blue]
                > Kevin,
                >
                > Thanks for the explanation. I am not sure whether
                > this applies or not, but I am looking to close the child
                > window after the child window posts back (not the
                > parent). The intended order of events:
                >
                > 1) User presses linkbutton in child window
                > 2) Child window posts pack to server
                > 3) Child window closes
                > 4) Parent window posts back to server
                >
                > Would the child window posting back to the server cause
                > the parent-child reference variable to be lost?
                >
                >[color=green]
                > >-----Original Message-----
                > >If I interpret your JavaScript correctly, it looks like[/color]
                > your script is[color=green]
                > >supposed to close the window AFTER a PostBack. The page[/color]
                > in the browser after[color=green]
                > >a postback is not the same page that was in the browser[/color]
                > BEFORE the PostBack.[color=green]
                > >It may be the same HTML document, but the memory of the[/color]
                > new instance is not[color=green]
                > >the same as the memory of the old - HTTP is stateless.[/color]
                > To the browser, it is[color=green]
                > >a whole new page. Therefore, there is no longer a window[/color]
                > object reference in[color=green]
                > >memory pointing to the child window. Using the same[/color]
                > variable name does[color=green]
                > >nothing.
                > >
                > >--
                > >HTH,
                > >
                > >Kevin Spencer
                > >Microsoft MVP
                > >..Net Developer
                > >http://www.takempis.com
                > >Neither a follower nor a lender be.
                > >
                > >
                > >"Mark Fox" <info@solelsoft ware.com> wrote in message
                > >news:070301c36 2dd$487816b0$a4 01280a@phx.gbl. ..[color=darkred]
                > >> Hello,
                > >>
                > >> I am attempting to do something very simple. I[/color][/color]
                > have[color=green][color=darkred]
                > >> a page MainPage.aspx and a popup window Popup.aspx.[/color][/color]
                > When[color=green][color=darkred]
                > >> users click on the linkbutton in the popup window I am
                > >> looking to do some server side processing in[/color][/color]
                > Popup.aspx,[color=green][color=darkred]
                > >> then have the popup window close, and have the
                > >> MainPage.aspx do a postback to the server. But I am
                > >> having trouble determining what client side javascript
                > >> Popup.aspx should render after it does its server side
                > >> processing. Are there any samples or articles tha
                > >> demonstrate how to do this? I keep getting "Object
                > >> Expected" in CloseChildWindo w():
                > >>
                > >> script.js
                > >> -------------------------------
                > >> var PopUp;
                > >>
                > >> // Called from MainPage.aspx
                > >> function OpenPopup(id, mode, eid)
                > >> {
                > >> var url = "";
                > >> url += "Controls/PopUp.aspx?";
                > >> url += "FormName=" + document.forms[0].name;
                > >> url += "&id="+ id;
                > >> url += "&m=" + mode;
                > >> url += "&eid="+ eid;
                > >>
                > >> var width = 250;
                > >> var height = 150;
                > >>
                > >> var str = "";
                > >> str += "toolbars=n o,";
                > >> str += "status=no, ";
                > >> str += "resizable= 0,";
                > >> str += "scrollbars=0," ;
                > >> str += "width=" + width + ",";
                > >> str += "height=" + height + ",";
                > >>
                > >> if ( window.screen ) {
                > >> var ah = screen.availHei ght - 30;
                > >> var aw = screen.availWid th - 10;
                > >>
                > >> var xc = ( aw - width ) / 2;
                > >> var yc = ( ah - height ) / 2;
                > >>
                > >> str += ",left=" + xc + ",screenX=" + xc;
                > >> str += ",top=" + yc + ",screenY=" + yc;
                > >> }
                > >>
                > >> PopUp = window.open( url, 'EmailList', str );
                > >> }
                > >>
                > >> function CloseChildWindo w(id, postBack)
                > >> {
                > >> debugger;
                > >> PopUp.close();
                > >> if (postBack)
                > >> __doPostBack(id ,'');
                > >> }
                > >>
                > >> The code I have in Popup.aspx is
                > >>
                > >> <script language="JavaS cript">
                > >> <!--
                > >>
                > >> window.onload=w indow_onload();
                > >>
                > >> function window_onload() {
                > >> window.opener.C loseChildWindow ('a', true);
                > >> }
                > >>
                > >> //-->
                > >> </script>
                > >>
                > >> Any help would be appreciated! Thanks.[/color]
                > >
                > >
                > >.
                > >[/color][/color]


                Comment

                • Kevin Spencer

                  #9
                  Re: Basic Javascript Question

                  Hi Mark,
                  [color=blue]
                  > Would the child window posting back to the server cause
                  > the parent-child reference variable to be lost?[/color]

                  When you use the JavaScript window.open() method, the window object that
                  refers to the child window is in the parent window's HTML document. If the
                  parent window posts back, the reference is lost, as the parent window's
                  document is unloaded. If the child window posts back, the document in the
                  child window changes, and all memory in that document is lost, but as the
                  reference to the child window is in the parent window's document, it isn't
                  lost.

                  The child window can close itself without any problems.

                  --
                  HTH,

                  Kevin Spencer
                  Microsoft MVP
                  ..Net Developer

                  Neither a follower nor a lender be.

                  "Mark Fox" <info@solelsoft ware.com> wrote in message
                  news:08ac01c365 b4$507f3b20$a00 1280a@phx.gbl.. .[color=blue]
                  > Kevin,
                  >
                  > Thanks for the explanation. I am not sure whether
                  > this applies or not, but I am looking to close the child
                  > window after the child window posts back (not the
                  > parent). The intended order of events:
                  >
                  > 1) User presses linkbutton in child window
                  > 2) Child window posts pack to server
                  > 3) Child window closes
                  > 4) Parent window posts back to server
                  >
                  > Would the child window posting back to the server cause
                  > the parent-child reference variable to be lost?
                  >
                  >[color=green]
                  > >-----Original Message-----
                  > >If I interpret your JavaScript correctly, it looks like[/color]
                  > your script is[color=green]
                  > >supposed to close the window AFTER a PostBack. The page[/color]
                  > in the browser after[color=green]
                  > >a postback is not the same page that was in the browser[/color]
                  > BEFORE the PostBack.[color=green]
                  > >It may be the same HTML document, but the memory of the[/color]
                  > new instance is not[color=green]
                  > >the same as the memory of the old - HTTP is stateless.[/color]
                  > To the browser, it is[color=green]
                  > >a whole new page. Therefore, there is no longer a window[/color]
                  > object reference in[color=green]
                  > >memory pointing to the child window. Using the same[/color]
                  > variable name does[color=green]
                  > >nothing.
                  > >
                  > >--
                  > >HTH,
                  > >
                  > >Kevin Spencer
                  > >Microsoft MVP
                  > >..Net Developer
                  > >http://www.takempis.com
                  > >Neither a follower nor a lender be.
                  > >
                  > >
                  > >"Mark Fox" <info@solelsoft ware.com> wrote in message
                  > >news:070301c36 2dd$487816b0$a4 01280a@phx.gbl. ..[color=darkred]
                  > >> Hello,
                  > >>
                  > >> I am attempting to do something very simple. I[/color][/color]
                  > have[color=green][color=darkred]
                  > >> a page MainPage.aspx and a popup window Popup.aspx.[/color][/color]
                  > When[color=green][color=darkred]
                  > >> users click on the linkbutton in the popup window I am
                  > >> looking to do some server side processing in[/color][/color]
                  > Popup.aspx,[color=green][color=darkred]
                  > >> then have the popup window close, and have the
                  > >> MainPage.aspx do a postback to the server. But I am
                  > >> having trouble determining what client side javascript
                  > >> Popup.aspx should render after it does its server side
                  > >> processing. Are there any samples or articles tha
                  > >> demonstrate how to do this? I keep getting "Object
                  > >> Expected" in CloseChildWindo w():
                  > >>
                  > >> script.js
                  > >> -------------------------------
                  > >> var PopUp;
                  > >>
                  > >> // Called from MainPage.aspx
                  > >> function OpenPopup(id, mode, eid)
                  > >> {
                  > >> var url = "";
                  > >> url += "Controls/PopUp.aspx?";
                  > >> url += "FormName=" + document.forms[0].name;
                  > >> url += "&id="+ id;
                  > >> url += "&m=" + mode;
                  > >> url += "&eid="+ eid;
                  > >>
                  > >> var width = 250;
                  > >> var height = 150;
                  > >>
                  > >> var str = "";
                  > >> str += "toolbars=n o,";
                  > >> str += "status=no, ";
                  > >> str += "resizable= 0,";
                  > >> str += "scrollbars=0," ;
                  > >> str += "width=" + width + ",";
                  > >> str += "height=" + height + ",";
                  > >>
                  > >> if ( window.screen ) {
                  > >> var ah = screen.availHei ght - 30;
                  > >> var aw = screen.availWid th - 10;
                  > >>
                  > >> var xc = ( aw - width ) / 2;
                  > >> var yc = ( ah - height ) / 2;
                  > >>
                  > >> str += ",left=" + xc + ",screenX=" + xc;
                  > >> str += ",top=" + yc + ",screenY=" + yc;
                  > >> }
                  > >>
                  > >> PopUp = window.open( url, 'EmailList', str );
                  > >> }
                  > >>
                  > >> function CloseChildWindo w(id, postBack)
                  > >> {
                  > >> debugger;
                  > >> PopUp.close();
                  > >> if (postBack)
                  > >> __doPostBack(id ,'');
                  > >> }
                  > >>
                  > >> The code I have in Popup.aspx is
                  > >>
                  > >> <script language="JavaS cript">
                  > >> <!--
                  > >>
                  > >> window.onload=w indow_onload();
                  > >>
                  > >> function window_onload() {
                  > >> window.opener.C loseChildWindow ('a', true);
                  > >> }
                  > >>
                  > >> //-->
                  > >> </script>
                  > >>
                  > >> Any help would be appreciated! Thanks.[/color]
                  > >
                  > >
                  > >.
                  > >[/color][/color]


                  Comment

                  • S. Justin Gengo

                    #10
                    Re: Basic Javascript Question

                    Mark,

                    The Javascript button you clicked on is not the actual code library. That
                    was a link to the javascript project I've built which contains javascripts I
                    use over and over. All the other javascripts and other code I haven't made
                    into classes is in the datagrid on the main code library page.

                    When you click the "code library" link on the site in the main area of the
                    page is a datagrid. Above the datagrid is a search text box and button. Do
                    your search there. Or page through the datagrid.

                    Sincerely,

                    --
                    S. Justin Gengo, MCP
                    Web Developer

                    Free code library at:


                    "Out of chaos comes order."
                    Nietzche


                    "Mark Fox" <info@solelsoft ware.com> wrote in message
                    news:038101c365 b4$b4bdc480$a10 1280a@phx.gbl.. .[color=blue]
                    > Justin,
                    >
                    > I downloaded the code from your site (which is very
                    > helpful stuff) but could not find the sample you referred
                    > to (I actually didn't find any samples). I also didn't
                    > find a search function on your site. Is the function
                    > you're referring to in the Javascript namespace? Where
                    > might I find the samples you mentioned? Thanks!
                    >[color=green]
                    > >-----Original Message-----
                    > >Mark,
                    > >
                    > >I have some code for just this at my website,[/color]
                    > www.aboutfortunate.com. Just[color=green]
                    > >search the code library for: "refresh main window" or[/color]
                    > something similar. The[color=green]
                    > >title of the sample you want is:
                    > >
                    > >Close a popup window and refresh the parent window
                    > >
                    > >Sincerely,
                    > >
                    > >--
                    > >S. Justin Gengo, MCP
                    > >Web Developer
                    > >
                    > >Free code library at:
                    > >www.aboutfortunate.com
                    > >
                    > >"Out of chaos comes order."
                    > > Nietzche
                    > >
                    > >
                    > >"Mark Fox" <info@solelsoft ware.com> wrote in message
                    > >news:070301c36 2dd$487816b0$a4 01280a@phx.gbl. ..[color=darkred]
                    > >> Hello,
                    > >>
                    > >> I am attempting to do something very simple. I[/color][/color]
                    > have[color=green][color=darkred]
                    > >> a page MainPage.aspx and a popup window Popup.aspx.[/color][/color]
                    > When[color=green][color=darkred]
                    > >> users click on the linkbutton in the popup window I am
                    > >> looking to do some server side processing in[/color][/color]
                    > Popup.aspx,[color=green][color=darkred]
                    > >> then have the popup window close, and have the
                    > >> MainPage.aspx do a postback to the server. But I am
                    > >> having trouble determining what client side javascript
                    > >> Popup.aspx should render after it does its server side
                    > >> processing. Are there any samples or articles tha
                    > >> demonstrate how to do this? I keep getting "Object
                    > >> Expected" in CloseChildWindo w():
                    > >>
                    > >> script.js
                    > >> -------------------------------
                    > >> var PopUp;
                    > >>
                    > >> // Called from MainPage.aspx
                    > >> function OpenPopup(id, mode, eid)
                    > >> {
                    > >> var url = "";
                    > >> url += "Controls/PopUp.aspx?";
                    > >> url += "FormName=" + document.forms[0].name;
                    > >> url += "&id="+ id;
                    > >> url += "&m=" + mode;
                    > >> url += "&eid="+ eid;
                    > >>
                    > >> var width = 250;
                    > >> var height = 150;
                    > >>
                    > >> var str = "";
                    > >> str += "toolbars=n o,";
                    > >> str += "status=no, ";
                    > >> str += "resizable= 0,";
                    > >> str += "scrollbars=0," ;
                    > >> str += "width=" + width + ",";
                    > >> str += "height=" + height + ",";
                    > >>
                    > >> if ( window.screen ) {
                    > >> var ah = screen.availHei ght - 30;
                    > >> var aw = screen.availWid th - 10;
                    > >>
                    > >> var xc = ( aw - width ) / 2;
                    > >> var yc = ( ah - height ) / 2;
                    > >>
                    > >> str += ",left=" + xc + ",screenX=" + xc;
                    > >> str += ",top=" + yc + ",screenY=" + yc;
                    > >> }
                    > >>
                    > >> PopUp = window.open( url, 'EmailList', str );
                    > >> }
                    > >>
                    > >> function CloseChildWindo w(id, postBack)
                    > >> {
                    > >> debugger;
                    > >> PopUp.close();
                    > >> if (postBack)
                    > >> __doPostBack(id ,'');
                    > >> }
                    > >>
                    > >> The code I have in Popup.aspx is
                    > >>
                    > >> <script language="JavaS cript">
                    > >> <!--
                    > >>
                    > >> window.onload=w indow_onload();
                    > >>
                    > >> function window_onload() {
                    > >> window.opener.C loseChildWindow ('a', true);
                    > >> }
                    > >>
                    > >> //-->
                    > >> </script>
                    > >>
                    > >> Any help would be appreciated! Thanks.[/color]
                    > >
                    > >
                    > >.
                    > >[/color][/color]


                    Comment

                    • Mark Fox

                      #11
                      Re: Basic Javascript Question

                      Kevin,

                      Thank you for your clear explanation! Based on
                      that, I was able to get it working with the child window
                      closing itself. Thanks a million.

                      [color=blue]
                      >-----Original Message-----
                      >Hi Mark,
                      >[color=green]
                      >> Would the child window posting back to the server cause
                      >> the parent-child reference variable to be lost?[/color]
                      >
                      >When you use the JavaScript window.open() method, the[/color]
                      window object that[color=blue]
                      >refers to the child window is in the parent window's[/color]
                      HTML document. If the[color=blue]
                      >parent window posts back, the reference is lost, as the[/color]
                      parent window's[color=blue]
                      >document is unloaded. If the child window posts back,[/color]
                      the document in the[color=blue]
                      >child window changes, and all memory in that document is[/color]
                      lost, but as the[color=blue]
                      >reference to the child window is in the parent window's[/color]
                      document, it isn't[color=blue]
                      >lost.
                      >
                      >The child window can close itself without any problems.
                      >
                      >--
                      >HTH,
                      >
                      >Kevin Spencer
                      >Microsoft MVP
                      >..Net Developer
                      >http://www.takempis.com
                      >Neither a follower nor a lender be.
                      >
                      >"Mark Fox" <info@solelsoft ware.com> wrote in message
                      >news:08ac01c36 5b4$507f3b20$a0 01280a@phx.gbl. ..[color=green]
                      >> Kevin,
                      >>
                      >> Thanks for the explanation. I am not sure whether
                      >> this applies or not, but I am looking to close the[/color][/color]
                      child[color=blue][color=green]
                      >> window after the child window posts back (not the
                      >> parent). The intended order of events:
                      >>
                      >> 1) User presses linkbutton in child window
                      >> 2) Child window posts pack to server
                      >> 3) Child window closes
                      >> 4) Parent window posts back to server
                      >>
                      >> Would the child window posting back to the server cause
                      >> the parent-child reference variable to be lost?
                      >>
                      >>[color=darkred]
                      >> >-----Original Message-----
                      >> >If I interpret your JavaScript correctly, it looks[/color][/color][/color]
                      like[color=blue][color=green]
                      >> your script is[color=darkred]
                      >> >supposed to close the window AFTER a PostBack. The[/color][/color][/color]
                      page[color=blue][color=green]
                      >> in the browser after[color=darkred]
                      >> >a postback is not the same page that was in the[/color][/color][/color]
                      browser[color=blue][color=green]
                      >> BEFORE the PostBack.[color=darkred]
                      >> >It may be the same HTML document, but the memory of[/color][/color][/color]
                      the[color=blue][color=green]
                      >> new instance is not[color=darkred]
                      >> >the same as the memory of the old - HTTP is stateless.[/color]
                      >> To the browser, it is[color=darkred]
                      >> >a whole new page. Therefore, there is no longer a[/color][/color][/color]
                      window[color=blue][color=green]
                      >> object reference in[color=darkred]
                      >> >memory pointing to the child window. Using the same[/color]
                      >> variable name does[color=darkred]
                      >> >nothing.
                      >> >
                      >> >--
                      >> >HTH,
                      >> >
                      >> >Kevin Spencer
                      >> >Microsoft MVP
                      >> >..Net Developer
                      >> >http://www.takempis.com
                      >> >Neither a follower nor a lender be.
                      >> >
                      >> >
                      >> >"Mark Fox" <info@solelsoft ware.com> wrote in message
                      >> >news:070301c36 2dd$487816b0$a4 01280a@phx.gbl. ..
                      >> >> Hello,
                      >> >>
                      >> >> I am attempting to do something very simple. I[/color]
                      >> have[color=darkred]
                      >> >> a page MainPage.aspx and a popup window Popup.aspx.[/color]
                      >> When[color=darkred]
                      >> >> users click on the linkbutton in the popup window I[/color][/color][/color]
                      am[color=blue][color=green][color=darkred]
                      >> >> looking to do some server side processing in[/color]
                      >> Popup.aspx,[color=darkred]
                      >> >> then have the popup window close, and have the
                      >> >> MainPage.aspx do a postback to the server. But I am
                      >> >> having trouble determining what client side[/color][/color][/color]
                      javascript[color=blue][color=green][color=darkred]
                      >> >> Popup.aspx should render after it does its server[/color][/color][/color]
                      side[color=blue][color=green][color=darkred]
                      >> >> processing. Are there any samples or articles tha
                      >> >> demonstrate how to do this? I keep getting "Object
                      >> >> Expected" in CloseChildWindo w():
                      >> >>
                      >> >> script.js
                      >> >> -------------------------------
                      >> >> var PopUp;
                      >> >>
                      >> >> // Called from MainPage.aspx
                      >> >> function OpenPopup(id, mode, eid)
                      >> >> {
                      >> >> var url = "";
                      >> >> url += "Controls/PopUp.aspx?";
                      >> >> url += "FormName=" + document.forms[0].name;
                      >> >> url += "&id="+ id;
                      >> >> url += "&m=" + mode;
                      >> >> url += "&eid="+ eid;
                      >> >>
                      >> >> var width = 250;
                      >> >> var height = 150;
                      >> >>
                      >> >> var str = "";
                      >> >> str += "toolbars=n o,";
                      >> >> str += "status=no, ";
                      >> >> str += "resizable= 0,";
                      >> >> str += "scrollbars=0," ;
                      >> >> str += "width=" + width + ",";
                      >> >> str += "height=" + height + ",";
                      >> >>
                      >> >> if ( window.screen ) {
                      >> >> var ah = screen.availHei ght - 30;
                      >> >> var aw = screen.availWid th - 10;
                      >> >>
                      >> >> var xc = ( aw - width ) / 2;
                      >> >> var yc = ( ah - height ) / 2;
                      >> >>
                      >> >> str += ",left=" + xc + ",screenX=" + xc;
                      >> >> str += ",top=" + yc + ",screenY=" + yc;
                      >> >> }
                      >> >>
                      >> >> PopUp = window.open( url, 'EmailList', str );
                      >> >> }
                      >> >>
                      >> >> function CloseChildWindo w(id, postBack)
                      >> >> {
                      >> >> debugger;
                      >> >> PopUp.close();
                      >> >> if (postBack)
                      >> >> __doPostBack(id ,'');
                      >> >> }
                      >> >>
                      >> >> The code I have in Popup.aspx is
                      >> >>
                      >> >> <script language="JavaS cript">
                      >> >> <!--
                      >> >>
                      >> >> window.onload=w indow_onload();
                      >> >>
                      >> >> function window_onload() {
                      >> >> window.opener.C loseChildWindow ('a', true);
                      >> >> }
                      >> >>
                      >> >> //-->
                      >> >> </script>
                      >> >>
                      >> >> Any help would be appreciated! Thanks.
                      >> >
                      >> >
                      >> >.
                      >> >[/color][/color]
                      >
                      >
                      >.
                      >[/color]

                      Comment

                      • Mark Fox

                        #12
                        Re: Basic Javascript Question

                        Justin,

                        Thank you for the explanation. I found it!
                        [color=blue]
                        >-----Original Message-----
                        >Mark,
                        >
                        >The Javascript button you clicked on is not the actual[/color]
                        code library. That[color=blue]
                        >was a link to the javascript project I've built which[/color]
                        contains javascripts I[color=blue]
                        >use over and over. All the other javascripts and other[/color]
                        code I haven't made[color=blue]
                        >into classes is in the datagrid on the main code library[/color]
                        page.[color=blue]
                        >
                        >When you click the "code library" link on the site in[/color]
                        the main area of the[color=blue]
                        >page is a datagrid. Above the datagrid is a search text[/color]
                        box and button. Do[color=blue]
                        >your search there. Or page through the datagrid.
                        >
                        >Sincerely,
                        >
                        >--
                        >S. Justin Gengo, MCP
                        >Web Developer
                        >
                        >Free code library at:
                        >www.aboutfortunate.com
                        >
                        >"Out of chaos comes order."
                        > Nietzche
                        >
                        >
                        >"Mark Fox" <info@solelsoft ware.com> wrote in message
                        >news:038101c36 5b4$b4bdc480$a1 01280a@phx.gbl. ..[color=green]
                        >> Justin,
                        >>
                        >> I downloaded the code from your site (which is[/color][/color]
                        very[color=blue][color=green]
                        >> helpful stuff) but could not find the sample you[/color][/color]
                        referred[color=blue][color=green]
                        >> to (I actually didn't find any samples). I also didn't
                        >> find a search function on your site. Is the function
                        >> you're referring to in the Javascript namespace? Where
                        >> might I find the samples you mentioned? Thanks!
                        >>[color=darkred]
                        >> >-----Original Message-----
                        >> >Mark,
                        >> >
                        >> >I have some code for just this at my website,[/color]
                        >> www.aboutfortunate.com. Just[color=darkred]
                        >> >search the code library for: "refresh main window" or[/color]
                        >> something similar. The[color=darkred]
                        >> >title of the sample you want is:
                        >> >
                        >> >Close a popup window and refresh the parent window
                        >> >
                        >> >Sincerely,
                        >> >
                        >> >--
                        >> >S. Justin Gengo, MCP
                        >> >Web Developer
                        >> >
                        >> >Free code library at:
                        >> >www.aboutfortunate.com
                        >> >
                        >> >"Out of chaos comes order."
                        >> > Nietzche
                        >> >
                        >> >
                        >> >"Mark Fox" <info@solelsoft ware.com> wrote in message
                        >> >news:070301c36 2dd$487816b0$a4 01280a@phx.gbl. ..
                        >> >> Hello,
                        >> >>
                        >> >> I am attempting to do something very simple. I[/color]
                        >> have[color=darkred]
                        >> >> a page MainPage.aspx and a popup window Popup.aspx.[/color]
                        >> When[color=darkred]
                        >> >> users click on the linkbutton in the popup window I[/color][/color][/color]
                        am[color=blue][color=green][color=darkred]
                        >> >> looking to do some server side processing in[/color]
                        >> Popup.aspx,[color=darkred]
                        >> >> then have the popup window close, and have the
                        >> >> MainPage.aspx do a postback to the server. But I am
                        >> >> having trouble determining what client side[/color][/color][/color]
                        javascript[color=blue][color=green][color=darkred]
                        >> >> Popup.aspx should render after it does its server[/color][/color][/color]
                        side[color=blue][color=green][color=darkred]
                        >> >> processing. Are there any samples or articles tha
                        >> >> demonstrate how to do this? I keep getting "Object
                        >> >> Expected" in CloseChildWindo w():
                        >> >>
                        >> >> script.js
                        >> >> -------------------------------
                        >> >> var PopUp;
                        >> >>
                        >> >> // Called from MainPage.aspx
                        >> >> function OpenPopup(id, mode, eid)
                        >> >> {
                        >> >> var url = "";
                        >> >> url += "Controls/PopUp.aspx?";
                        >> >> url += "FormName=" + document.forms[0].name;
                        >> >> url += "&id="+ id;
                        >> >> url += "&m=" + mode;
                        >> >> url += "&eid="+ eid;
                        >> >>
                        >> >> var width = 250;
                        >> >> var height = 150;
                        >> >>
                        >> >> var str = "";
                        >> >> str += "toolbars=n o,";
                        >> >> str += "status=no, ";
                        >> >> str += "resizable= 0,";
                        >> >> str += "scrollbars=0," ;
                        >> >> str += "width=" + width + ",";
                        >> >> str += "height=" + height + ",";
                        >> >>
                        >> >> if ( window.screen ) {
                        >> >> var ah = screen.availHei ght - 30;
                        >> >> var aw = screen.availWid th - 10;
                        >> >>
                        >> >> var xc = ( aw - width ) / 2;
                        >> >> var yc = ( ah - height ) / 2;
                        >> >>
                        >> >> str += ",left=" + xc + ",screenX=" + xc;
                        >> >> str += ",top=" + yc + ",screenY=" + yc;
                        >> >> }
                        >> >>
                        >> >> PopUp = window.open( url, 'EmailList', str );
                        >> >> }
                        >> >>
                        >> >> function CloseChildWindo w(id, postBack)
                        >> >> {
                        >> >> debugger;
                        >> >> PopUp.close();
                        >> >> if (postBack)
                        >> >> __doPostBack(id ,'');
                        >> >> }
                        >> >>
                        >> >> The code I have in Popup.aspx is
                        >> >>
                        >> >> <script language="JavaS cript">
                        >> >> <!--
                        >> >>
                        >> >> window.onload=w indow_onload();
                        >> >>
                        >> >> function window_onload() {
                        >> >> window.opener.C loseChildWindow ('a', true);
                        >> >> }
                        >> >>
                        >> >> //-->
                        >> >> </script>
                        >> >>
                        >> >> Any help would be appreciated! Thanks.
                        >> >
                        >> >
                        >> >.
                        >> >[/color][/color]
                        >
                        >
                        >.
                        >[/color]

                        Comment

                        • Kevin Spencer

                          #13
                          Re: Basic Javascript Question

                          You're very kind. :)

                          --
                          You're welcome,

                          Kevin Spencer
                          Microsoft MVP
                          ..Net Developer
                          All hotels in Benidorm. The best selection of Benidorm hotels with reviews and maps. Book in advance and save.

                          Neither a follower nor a lender be.

                          "Mark Fox" <info@solelsoft ware.com> wrote in message
                          news:099f01c366 c2$14987450$a10 1280a@phx.gbl.. .[color=blue]
                          > Kevin,
                          >
                          > Thank you for your clear explanation! Based on
                          > that, I was able to get it working with the child window
                          > closing itself. Thanks a million.
                          >
                          >[color=green]
                          > >-----Original Message-----
                          > >Hi Mark,
                          > >[color=darkred]
                          > >> Would the child window posting back to the server cause
                          > >> the parent-child reference variable to be lost?[/color]
                          > >
                          > >When you use the JavaScript window.open() method, the[/color]
                          > window object that[color=green]
                          > >refers to the child window is in the parent window's[/color]
                          > HTML document. If the[color=green]
                          > >parent window posts back, the reference is lost, as the[/color]
                          > parent window's[color=green]
                          > >document is unloaded. If the child window posts back,[/color]
                          > the document in the[color=green]
                          > >child window changes, and all memory in that document is[/color]
                          > lost, but as the[color=green]
                          > >reference to the child window is in the parent window's[/color]
                          > document, it isn't[color=green]
                          > >lost.
                          > >
                          > >The child window can close itself without any problems.
                          > >
                          > >--
                          > >HTH,
                          > >
                          > >Kevin Spencer
                          > >Microsoft MVP
                          > >..Net Developer
                          > >http://www.takempis.com
                          > >Neither a follower nor a lender be.
                          > >
                          > >"Mark Fox" <info@solelsoft ware.com> wrote in message
                          > >news:08ac01c36 5b4$507f3b20$a0 01280a@phx.gbl. ..[color=darkred]
                          > >> Kevin,
                          > >>
                          > >> Thanks for the explanation. I am not sure whether
                          > >> this applies or not, but I am looking to close the[/color][/color]
                          > child[color=green][color=darkred]
                          > >> window after the child window posts back (not the
                          > >> parent). The intended order of events:
                          > >>
                          > >> 1) User presses linkbutton in child window
                          > >> 2) Child window posts pack to server
                          > >> 3) Child window closes
                          > >> 4) Parent window posts back to server
                          > >>
                          > >> Would the child window posting back to the server cause
                          > >> the parent-child reference variable to be lost?
                          > >>
                          > >>
                          > >> >-----Original Message-----
                          > >> >If I interpret your JavaScript correctly, it looks[/color][/color]
                          > like[color=green][color=darkred]
                          > >> your script is
                          > >> >supposed to close the window AFTER a PostBack. The[/color][/color]
                          > page[color=green][color=darkred]
                          > >> in the browser after
                          > >> >a postback is not the same page that was in the[/color][/color]
                          > browser[color=green][color=darkred]
                          > >> BEFORE the PostBack.
                          > >> >It may be the same HTML document, but the memory of[/color][/color]
                          > the[color=green][color=darkred]
                          > >> new instance is not
                          > >> >the same as the memory of the old - HTTP is stateless.
                          > >> To the browser, it is
                          > >> >a whole new page. Therefore, there is no longer a[/color][/color]
                          > window[color=green][color=darkred]
                          > >> object reference in
                          > >> >memory pointing to the child window. Using the same
                          > >> variable name does
                          > >> >nothing.
                          > >> >
                          > >> >--
                          > >> >HTH,
                          > >> >
                          > >> >Kevin Spencer
                          > >> >Microsoft MVP
                          > >> >..Net Developer
                          > >> >http://www.takempis.com
                          > >> >Neither a follower nor a lender be.
                          > >> >
                          > >> >
                          > >> >"Mark Fox" <info@solelsoft ware.com> wrote in message
                          > >> >news:070301c36 2dd$487816b0$a4 01280a@phx.gbl. ..
                          > >> >> Hello,
                          > >> >>
                          > >> >> I am attempting to do something very simple. I
                          > >> have
                          > >> >> a page MainPage.aspx and a popup window Popup.aspx.
                          > >> When
                          > >> >> users click on the linkbutton in the popup window I[/color][/color]
                          > am[color=green][color=darkred]
                          > >> >> looking to do some server side processing in
                          > >> Popup.aspx,
                          > >> >> then have the popup window close, and have the
                          > >> >> MainPage.aspx do a postback to the server. But I am
                          > >> >> having trouble determining what client side[/color][/color]
                          > javascript[color=green][color=darkred]
                          > >> >> Popup.aspx should render after it does its server[/color][/color]
                          > side[color=green][color=darkred]
                          > >> >> processing. Are there any samples or articles tha
                          > >> >> demonstrate how to do this? I keep getting "Object
                          > >> >> Expected" in CloseChildWindo w():
                          > >> >>
                          > >> >> script.js
                          > >> >> -------------------------------
                          > >> >> var PopUp;
                          > >> >>
                          > >> >> // Called from MainPage.aspx
                          > >> >> function OpenPopup(id, mode, eid)
                          > >> >> {
                          > >> >> var url = "";
                          > >> >> url += "Controls/PopUp.aspx?";
                          > >> >> url += "FormName=" + document.forms[0].name;
                          > >> >> url += "&id="+ id;
                          > >> >> url += "&m=" + mode;
                          > >> >> url += "&eid="+ eid;
                          > >> >>
                          > >> >> var width = 250;
                          > >> >> var height = 150;
                          > >> >>
                          > >> >> var str = "";
                          > >> >> str += "toolbars=n o,";
                          > >> >> str += "status=no, ";
                          > >> >> str += "resizable= 0,";
                          > >> >> str += "scrollbars=0," ;
                          > >> >> str += "width=" + width + ",";
                          > >> >> str += "height=" + height + ",";
                          > >> >>
                          > >> >> if ( window.screen ) {
                          > >> >> var ah = screen.availHei ght - 30;
                          > >> >> var aw = screen.availWid th - 10;
                          > >> >>
                          > >> >> var xc = ( aw - width ) / 2;
                          > >> >> var yc = ( ah - height ) / 2;
                          > >> >>
                          > >> >> str += ",left=" + xc + ",screenX=" + xc;
                          > >> >> str += ",top=" + yc + ",screenY=" + yc;
                          > >> >> }
                          > >> >>
                          > >> >> PopUp = window.open( url, 'EmailList', str );
                          > >> >> }
                          > >> >>
                          > >> >> function CloseChildWindo w(id, postBack)
                          > >> >> {
                          > >> >> debugger;
                          > >> >> PopUp.close();
                          > >> >> if (postBack)
                          > >> >> __doPostBack(id ,'');
                          > >> >> }
                          > >> >>
                          > >> >> The code I have in Popup.aspx is
                          > >> >>
                          > >> >> <script language="JavaS cript">
                          > >> >> <!--
                          > >> >>
                          > >> >> window.onload=w indow_onload();
                          > >> >>
                          > >> >> function window_onload() {
                          > >> >> window.opener.C loseChildWindow ('a', true);
                          > >> >> }
                          > >> >>
                          > >> >> //-->
                          > >> >> </script>
                          > >> >>
                          > >> >> Any help would be appreciated! Thanks.
                          > >> >
                          > >> >
                          > >> >.
                          > >> >[/color]
                          > >
                          > >
                          > >.
                          > >[/color][/color]


                          Comment

                          Working...