Asp net requiredfieldvalidator not validating
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.
In front of each field, we add a Required Field Validator.If a client with Internet Explorer 4.0 or later uses your page, it can do the same input validation that takes place on the server without you having to write any special client script.The client side validation has a number of features: In order to use validators effectively, it helps to have a firm definition of what they are.The final step is to add a validation summary to the top of the page like so: Here is how it looks on the page: Next we need to enforce the character requirements for the User ID and Password fields.For these we will use Regular Expression Validator controls.You need to write the server-based checks anyway for clients without script, so it can be hard to justify writing it all over again for rich clients.
Validation controls change all that, because almost all the duplicated logic is encapsulated in the controls.
The validator controls are the main elements of the solution. NET control that checks a specific validity condition of another control.
It generally appears to the user as a piece of text that displays or hides depending on whether the control it is checking is in error.
While this might seem cumbersome, remember that to be helpful to the user, you would want to have three different text descriptions for all these cases.
The different types of validators are listed as follows: Write a web page to collect a new user id and password.
The user id must contain 6-10 alpha characters and must not already be in use.