Child window property window.opener null after postback

Discussion in 'ASP .Net Security' started by MrFez, Apr 28, 2005.

  1. MrFez

    MrFez Guest

    I have an webform from which I open a child window to display a calendar.
    When a date is selected in the calendar window it attempts to set the value
    of a textbox in the main (parent) window by using the window.opener property
    to reference the textbox.

    Everything works fine initially. However if the the main window does a
    postback and the calendar is re-opened, its window.opener property will
    always be null.

    So: BEFORE main window executes a postback the calendar can be opened,
    close, and re-opened many times and window.opener is set properly.

    AFTER main window does a postback (another button was clicked) the calendar
    window can be opened but it cannot return a value because window.opener is
    always null.

    Note, this seems to be primarily a problem with Windows XP SP2 clients.
    Windows Server 2003 SP1 clients do not seem to have this problem.

    Any ideas?
     
    MrFez, Apr 28, 2005
    #1
    1. Advertising

  2. Hi,
    I think problem is caused by another reason. For example test the case given
    below. This should always work. it is not important ASP.NET/html. Because in
    your case always client side is executed.

    "opener.html"

    <html>
    <head>
    </head>
    <body>
    <a href="#" onclick="javascript:window.open('child.html')"> child </a><br>
    <a href="http://www.msakademik.net" >MSAkademik.NET</a>
    </body>
    </html>

    "child.html"

    <html>
    <head>
    </head>
    <body>
    <a href="javascript:test()"> MSAkademik.NET</a>
    </body>
    </html>
    <script language="javascript">
    function test()
    {
    alert(window.opener)
    }
    </script>


    "MrFez" <> wrote in message
    news:...
    >I have an webform from which I open a child window to display a calendar.
    > When a date is selected in the calendar window it attempts to set the
    > value
    > of a textbox in the main (parent) window by using the window.opener
    > property
    > to reference the textbox.
    >
    > Everything works fine initially. However if the the main window does a
    > postback and the calendar is re-opened, its window.opener property will
    > always be null.
    >
    > So: BEFORE main window executes a postback the calendar can be opened,
    > close, and re-opened many times and window.opener is set properly.
    >
    > AFTER main window does a postback (another button was clicked) the
    > calendar
    > window can be opened but it cannot return a value because window.opener is
    > always null.
    >
    > Note, this seems to be primarily a problem with Windows XP SP2 clients.
    > Windows Server 2003 SP1 clients do not seem to have this problem.
    >
    > Any ideas?
    >
     
    Yunus Emre ALPÖZEN [MCP], Apr 28, 2005
    #2
    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. =?Utf-8?B?TXJGZXo=?=

    Child window property window.opener null after postback

    =?Utf-8?B?TXJGZXo=?=, Apr 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    5,708
    =?Utf-8?B?TXJGZXo=?=
    Apr 28, 2005
  2. Urs Gubler
    Replies:
    0
    Views:
    170
    Urs Gubler
    Jul 2, 2003
  3. js
    Replies:
    0
    Views:
    188
  4. Replies:
    1
    Views:
    263
  5. window.opener, form.opener?

    , Jul 14, 2006, in forum: Javascript
    Replies:
    5
    Views:
    302
Loading...

Share This Page