title: Access content page controls in pop up window(.aspx page) using javascript
body: <p>I have a mater page. Within that I have a content page. I am opening a pop up window from this content page using using window.open method. I also tried opening a modal dialog box as an alternate option.</p>
  
  <p><pre><code>
  window.open("WebForm2.aspx?name1="+d+"&amp;name2="e+,"MyWindow","height=375,width=350");
  </pre></code></p>
  
  <p>'d' &amp; 'e'  are the control id,  that I have passed, and accessing in pop up window.</p>
  
  <p>I want to access control values in the content page from the pop up(and vice-versa). All the controls that I am attemptimg. to access are in a gridview. However, I am unable to do so?</p>
  
  <p>To acheive this,  I passed the specific values, that I intend to access, in the url, to the pop up window. This way the values are accessible but they seem very cumbersome. </p>
  
  <p><pre><code>
  alert(window.opener.document.getElementById(GetQueryStringParams('name1')).value); 
  </pre></code></p>
  
  <p><pre><code>
  function GetQueryStringParams(sParam)
  {
      var sPageURL = window.location.search.substring(1);
      var sURLVariables = sPageURL.split('&amp;');
      for (var i = 0; i &lt; sURLVariables.length; i++) 
      {
          var sParameterName = sURLVariables[i].split('=');
          if (sParameterName[0] == sParam) 
          {
              return sParameterName[1];
          }
      }
  }
  </pre></code></p>
  
  <p>I cannot find a way to access values of pop up page to content page.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks in advance</p>