Start Validating text box in asp net

Validating text box in asp net

Validating, in this case, does not mean that if John Doe types his name into the form field of a text box as Fred Doe the computer sends an alert to inform you that the data is untruthful.

The following example describes a form to be filled up by all the students of a school, divided into four houses, for electing the school president.

Here, we use the validation controls to validate the user input.

These forms are made up of different types of HTML elements that are constructed using straight HTML, HTML server controls, or Web server controls.

Is Valid is true inside the Click post back event handler method of your button. Take a look at this article for more on this and many other common validation questions: Copy and paste the following code: If (Is Numeric(txt Box. While he can create alternatives to validation, he's using a Compare Validator.

then in the control to validate property of the validator, setect your text box then do what u need, like what to validate integer etc You probably did not setup server side validation correctly.

(WHen Enable Client Script=false, ONLY server side validation is used. If it does not find it, you can always make one on your own. C# code: try catch VB code: try catch I hope this helps you to solve your problem.

changing it's property to be not read-only and use Validation Group is a useful property which tells the program to do validation only if controls that will be validated and that which caused validation (or caused the postback eg:a button) belongs to the same when u make readonly it means that u cant add/edit text into it.