Of you are checking validation on client side, then you have to do something like below.
function isValidated()
{
If(validation passed)
{
return true;
}
else
{
return false;
}
}
That means whenever validation is failed, it should return false, so that it will not
PostBack
and show the message properly.