Cant call Javascript function from button onclick event ASP.NET 4
<p>when every i call a Javascript function from asp:button onclick event i got this error message</p>

<p>HTML</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>
