Vb net validating controls

10 Oct

I would like to achieve this by creating a method that loop through all the Listbox and Textboxes on a form making sure that is not empty and if its empty give user another chance to enter valid data.

This is working on every form as subprocedure, however I do have four forms and I would like to write the code once and call it from all my four forms.

(All pages have all the buttons) When a page loads and decide I want to go to a different page without entering information into the form, I click a button to move to a separate page and the validation pops up and I can't change the page, it stops me every time? This is straight from the Microsoft Help Page: By default, page validation is performed when a Button control is clicked.Let's give it a try, and add a Required Field Validator to our page.We will also add a Text Box to validate, as well as a button to submit the form with.Page validation determines whether the input controls associated with a validation control on the page all pass the validation rules specified by the validation control.You can specify or determine whether validation is performed on both the client and the server when a Button control is clicked by using the Causes Validation property.