Professional Web Applications Themes

Child window property window.opener null after postback - ASP.NET Security

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 ...

  1. #1

    Default Child window property window.opener null after postback

    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 Guest

  2. #2

    Default Re: Child window property window.opener null after postback

    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" <MrFezdiscussions.microsoft.com> wrote in message
    news:22551215-F170-4F94-9281-E2C23D287C02microsoft.com...
    >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] Guest

Similar Threads

  1. Child Controls => Postback? => null?
    By szabelin in forum ASP.NET General
    Replies: 1
    Last Post: July 29th, 06:51 AM
  2. Refreshing or Redirecting Opener Window
    By Dan M in forum ASP.NET General
    Replies: 3
    Last Post: July 9th, 05:18 PM
  3. RePosting window.opener windows to server.
    By Ersin Gençtürk in forum ASP.NET General
    Replies: 0
    Last Post: July 3rd, 05:58 AM
  4. Replies: 2
    Last Post: June 30th, 06:37 PM
  5. window.opener.location.href doesn't work in frame
    By Leon in forum ASP.NET General
    Replies: 1
    Last Post: June 24th, 01:57 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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139