title: Get values from modal popup in parent window's button click event
body: <p>I need to display a modal popup from a aspx.cs page. I need to invoke the popup from server side because before the popup opens, I need to pass an ID into the popup via query string.</p>
  
  <p>this is my code to display the popup.</p>
  
  <pre><code> protected void btnNote_Click(object sender, EventArgs e)
      {
          string queryStringParam = "some text"; // some server code here to get the string ready;            
          ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "openNotePopup('"+ queryStringParam  +"');", true);           
      }
  </code></pre>
  
  <p>And this is the javascript to get the parameter and launch the modal popup.</p>
  
  <pre><code>function openNotePopup(var param) 
  {
      var noteResult = window.showModalDialog("AddEditNote.aspx?Note=" + param, "Add/Edit Notes", 'center:yes; dialogWidth:600px; dialogHeight:500px;');
      document.getElementById("hidden_NoteText").value = noteResult;
  }
  </code></pre>
  
  <p>When the popup is closed, I pass a string value as window.returnValue which is captured in the noteResult variable in client side.</p>
  
  <p>Now I need to capture the popup close event in my server side. I can capture the event in client side but I need the event in server side so that I can pick up the value from the hidden field and process it.</p>
  
  <p>How can I achieve this? </p>