Validating user input in a web forms page

Rated 4.90/5 based on 916 customer reviews

You will need to add this protection manually if any input will be used in HTML output.

Would you like to answer one of these unanswered questions instead? If that doesn;t work, then look at using Custom Validator to call javascript function that will do the validation on clients for sure. Is Valid, when the Submit button is clicked on the webpage, control is transferred to the C# code. You code doesn't suggest that it is set to false, causing server side validation.So before saving data, I want to validate whether all the required fields are filled (Text Boxes) by the user. I would rather use a generic function that would be passed each control on the form and based on the type of the control, separate validation logic would be case extra validation like restricting validation to some of the controls only, that would be decided at the function calling level.

Leave a Reply