Validating asp net server controls

Now you will see the browser posting back to the server, but the result will be the same - the validator still works!

Right now, the button does nothing, besides posting back if the page is valid.

It would be great that validation can be triggered by calling the Page.

Is Valid: Validate which also validate normal required fields etc...

Actually, that's all we need to test the most basic part of the Required Field Validator. Validation is only performed serverside if necessary!

We will also add a Text Box to validate, as well as a button to submit the form with.

Hi, I have a custom control allowing the user to enter a username and the system to retrieve the user id that correspond with the user name.

The idea now is to have (input)validation in the usercontrol, so that the custom control will show an error when the user enters a non-existing username == no id can be retrieved from the DB on this input.

So how can I insert this validation in the control??

Interesting to say, the username is created as a combination of a dropdownlist and a textbox.

Leave a Reply