title: Find control of master page working in code behind but not in javascript in content page
body: <p>I am using vb.net with framework 4.0 ; I am trying to access an asp panel in master page from my content page. In code behind this is working in a button click:</p>
  
  <pre><code>CType(Me.Master.FindControl("PanelMsg"), Panel).Visible = True
  </code></pre>
  
  <p>Now I am trying to make the same thing but in client side of my content page:</p>
  
  <pre><code>window.onload = test;
  
   function test() {
       var pan = document.getElementById('&lt;%=CType(Me.Master.FindControl("PanelMsg"), Panel) %&gt;');
       // var pan = document.getElementById('&lt;%=(Master.FindControl("PanelMsg")).ClientID %&gt;');
       alert(pan);
   } 
  </code></pre>
  
  <p>pan is null in both cases. How can I resolve this issue in order to make pan visible and change its value?</p>