function manageValidation()
{
Validate the Page:
// validate all the validation that are present in the page.
Page_ClientValidate();
Validate the Page having certain validation Group:
// validate all the validation that are present in the page with this validation group.
Page_ClientValidate('ValidationGroup');
Get Is the page valid:
// Check wheather the page is valid or not
var pageValidated = Page_IsValid;
if (pageValidated)
{
// Write some custom messages like
alert('Thanks for signing up with us. we will send your password to respective mail account');
}
else
{
// Other messages..
}
Enable or disable any validation :
// disable a certion validation
// ValidatorEnable(Control Name, status)
ValidatorEnable('requiredvalidatorTxtLastName', false)
// Enable some validation.
ValidatorEnable('requiredvalidatorTxtUserName', true)
Force Validation:
// Attach a certion validation with the control
ValidatorHookupControl('txtUserName', 'requiredvalidatorTxtUserName')
// Validate a certain validation.
ValidatorValidate('requiredvalidatorTxtUserName')
}
Manual Validation :
If you want to make the validation false of the page for any customize javascript Code you can do it as follows.
function checkPoints(sender,args)
{
if(document.getElementById('txtPoints').value == (parseInt( document.getElementById('txtBasicPoint').value) * 2)
{
args.isValid = false;
}
}
And attach this function with any control.
So when this piece of code will get executed it will set the isValid property of the page false. (Which should be true for making a post back) and hence we can ask the system to stop the postback.