title: How to refresh parent without losing its ViewState?
body: <p>I use this script on the child window to refresh the parent window on clicking "Close &amp; Refresh" :</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
          function RefreshParent() {
              if (window.opener != null &amp;&amp; !window.opener.closed) {
                  window.opener.location.href = window.opener.location;
              }
          }
  
      &lt;/script&gt;
  </code></pre>
  
  <p>However when the parent window is refreshed, the Id saved in a <code>ViewState</code> is lost and i can no longer bind my control.</p>
  
  <p>Any suggestion of workarounds ?</p>
  
  <p>EDIT: </p>
  
  <p>Answering one of the comments: I wasn't able to use Sessions as I need to clear the session on the "Unload Event", however I discovered that the Unload event is called on postbacks (please correct me if i'm wrong) and would still lose the value. </p>