OnClientClick
is an attribute for
Asp:Button which takes
boolean
value as input from a
javascript
code or a function.
if the
OnClientClick
value is
true
, it will fire (
PostBack) the server Event (
OnClick
), else it will remain same in that page.
OnClientClick ="return true"
OnClientClick ="return false"
Now you can write your code which suits your requirement.
By defalut the
OnClientClick
is set to
true
, if you have not added the attribute in the tag.
if you want to call it from a function.
function SomeJsFunction()
{
if (....Your Code.....)
return true;
else
return false;
}
OnClientClick="return SomeJsFunction();"