ASP.NET JavaScript popup window failing at getting a property
<p>In my ASP.NET application, my popup window is returning null for a specific variable. </p>

<p>When I click a button this JavaScript gets fired:</p>



<pre><code>function Picker_OrderDefaultFirst() {
    OpenPageWithParam('OrderPermanentItems', '?ID=' + "&lt;%=CommitteeUId %&gt;" + "&amp;btn=1", returnOrderPicker);
    return false;
}
</code></pre>

<p><code>returnOrderPicker</code> looks like: </p>



<pre><code>function returnOrderPicker() {
    alert("Test fra returnOrderPicker");
}
</code></pre>

<p><code>OpenPageWithParam</code> looks like: </p>



<pre><code>function OpenPageWithParam(PageName, Query, ReturnFunction) {
    var _window = null;

    InitBlocker();

    switch (PageName) {

        case "OrderPermanentItems":
            _window = PopupCenter(ROOT_DIR + "/Forms/Pickers/PermanentItemsPicker.aspx" + Query, PageName, 590, 600);
            break;
    }

    _window.ReturnFunction = ReturnFunction;

    return _window;
}
</code></pre>

<p>I'm setting the popup window's property <code>ReturnFunction</code> to be <code>ReturnFunction</code> of data from previous page. (In this example <code>returnOrderPicker</code> Function). </p>

<p>But, when window pops up, the value of <code>window.ReturnValue</code> is <code>undefined</code>. </p>

<p>Calling in popup window looks like: </p>



<pre><code>&lt;script type="text/javascript" language="javascript"&gt;
    window.onload = function (sender, eventArgs) { alert(window.ReturnFunction + " Window PermanentItemPickerPopup "); }
&lt;/script&gt;
</code></pre>

<p>Any ideas? </p>
