Form postback and validation
Hi,
I am new to .Net and come from Java.
I have a form in a page. I tell the form to go to a second page in the Button object with postbackurl. Before, I make some validation using a CustomValidator. The method in the validator just sets the args.IsValid to false. In case of a bad validation, I am redirected to the second page, instead of staying at the same page, though the validation method is called.
My code:
Validation:
public void myValidate(object source, System.Web.UI.WebControls.ServerValidateEventArgs args)
{
if (...)
{
args.IsValid = false;
}
}
Button definition:
Any hint on what goes wrong?
Thank you
Samuel
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Munir ShaikhRank #472 · 5.3K reputationPosted Jul 30, 2007, 2:44 AM EDT
Instead of writing your own code microsoft had already provided with the facility called as "Page.IsValid" which will check if page validation true or false the you can redirect to particular page
Regards,
>>Munnamax