title: Cant call Javascript function from button onclick event ASP.NET 4
body: <p>when ever i call a JavaScript function from <code>asp:button</code> <code>onclick</code> event i got this error message</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;asp:Button ID="btnFromCalOpen" runat="server" Text=" &amp;gt; "  onclick="ShowCal()"  CssClass = "SElementHide" /&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>function ShowCal() {
  
      var elem = document.getElementById('MainContent_CalendarFrom');
      if (elem.visibility = "hidden" )
      {
      elema.style.visibility = "visible";
      elema.style.display = "block";
      }
      else
      {
      elema.style.visibility = "hidden";
      elema.style.display = "none";
      }
  }
  </code></pre>
  
  <p>Error
  Compiler Error Message: BC30456: 'ShowCal' is not a member of 'ASP.default_aspx'.</p>
  
  <p>Please Help</p>