when ever i call a JavaScript function from asp:button
onclick
event i got this error message
HTML
<asp:Button ID="btnFromCalOpen" runat="server" Text=" > " onclick="ShowCal()" CssClass = "SElementHide" />
Javascript
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";
}
}
Error Compiler Error Message: BC30456: 'ShowCal' is not a member of 'ASP.default_aspx'.
Please Help
Use OnClientClick
to have your ASP.NET button run a JavaScript method before calling its server-side method. OnClick
specifies the server side method to run.
<asp:Button ID="btnFromCalOpen" runat="server"
Text=" > " CssClass = "SElementHide"
OnClientClick="ShowCal()" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With