Friday, January 4, 2008

Why we call Page.Validate() and check Page.IsValid even when we have client side validation?

From end user perspective, client side validation is absolutely giving more benefits. Anyway, technically who can trust the user inputs? Because JavaScript is key player in client side valuation but anyone can bypass the JavaScript by disabling it. Not only that, brilliant hacker can swap the JavaScript validation functions through automated process.

Solution with ASP.NET 2.0:
FAQ00004

When Page.Validate() is fired, it automatically check the CausesValidation = true controls and return the page validation status through Page.IsValid property. Here you have another option to call Page.Validate() method for specific validation group and get the status.

BTW: Don’t forget to call Page.Validate() before checking Page.IsValid.

Labels:

0 Comments:

Post a Comment

<< Home