Validating time in ajax

Our objective with validation is as follows: We visited a large number of real pages to determine the sort of scenarios these components needed to be able to handle.

We wanted to dramatically reduce the amount of validation code needed for future applications.

The Validation Summary automatically generates this content by gathering it up from validator controls on the page. It exposes the all-important "Is Valid" property, which you check in server code to determine if all of the user input is OK.

Most Web sites do all of their validation checks on the server.

If the input field is blank, we want to display an asterisk (*) in front of the field and report a text error in a summary area.

Here is how we add a Required Field Validator to the User ID field: The * is displayed next to the label if the input is blank. The "Control To Validate" property specifies the ID of the control to validate.

This usually means that if you want to use script to improve the interface of your pages, you have to write the same validation logic twice, once on the client, and again on the server, just in case the client script cannot be executed.

The user id must contain 6-10 alpha characters and must not already be in use.

The password must contain 4-12 letters and at least one of the characters "@#$%^&*/." The user must re-enter the password to make sure they entered it correctly.

DTHML and scripting languages improve things somewhat.

It is possible to provide the user with immediate feedback on bad input and to prevent them from posting a page until it has been corrected.

Leave a Reply