Validating filenames with regularexpressionvalidator
Traditionally, Web developers have faced a tough choice when adding form validation logic to their pages.
You can add form validation routines to your server-side code, or you can add the validation routines to your client-side code.
You can assign any name to a validation group, but you must use the same name for all members of the group.
During postback, the property is set based only on the validation controls in the current validation group.
The current validation group is determined by the control that caused validation to occur.
For example, if a button control with a validation group of are valid.
The only question I have left is why the weird behavior? You create a validation group by setting the Validation Group property to the same name (a string) for all the controls you want to group.Fortunately, the Validation controls discussed in this chapter do not force you to make this difficult choice.The Validation controls automatically generate both client-side and server-side code.You should be warned, however, that client-side validation works only with Microsoft Internet Explorer version 4.0 and higher. If you request a page that contains a validation control, and you are using Microsoft Internet Explorer version 4.0 or higher, Java Script code is automatically sent to your browser.
In particular, the client-side scripts discussed in this chapter do not work with any version of Netscape Navigator. If, for whatever reason, you want to disable client-side form validation, you can do so by adding the following directive at the top of your page: This directive disables client-side form validation.
The advantage of writing validation logic in client-side code is that you can provide instant feedback to your users.