posted 12/29/2008 by Sumit Arora
Yesterday i was working on a registration page where if a person check the checkbox where the terms and conditions are
written only then he/she can register .So i used a client side validation if a person doesn't select the checkbox then the
alert box will appear where it is written that you must follow the terms and conditions.
But on doing this the server side validations stopped working . I culdn't find the reason why was it happening .I searched
it on google as well but culdn't find the solution to it. Then one of my colleague told me to use Page.Validate() method and
Page.IsValid on the button click and it worked .
protected void btnRegister_Click(object sender, EventArgs e)
{
Page.Validate();
if (Page.IsValid) { RegisterUser(); }
}
What kind of email newsletter would you prefer to receive from CodeAsp.Net?18