26th February 02:39
CausesValidation not working as expected.
This is a hairy one.
I have a situation in which the textbox.validating event fires when it
should not. The Text box is itself contained in a user control, which is
then loaded dynamically into a panel on a form. The form has some buttons on
it, some of which have CausesValidation set to True, and some of which have
CausesValidation set to false. The buttons themselves are on the form, not
inside the user control The User Control contains a required field validator
extender control as in the book "Developing Microsft .NET Controls with
Microsoft Visual Basic .NET." The Extender simply captures the Validating
event from the textbox and returns true if there is text in the box, and
Given the way I have the control set up, the Validating Event for the
textbox should not be firing when I click a button with
CausesValidation=False. In fact, the Validating Event does NOT fire in this
scenario IF THE CONTROLS ARE ALL DIRECTLY ON THE FORM ITSELF. It's only in
this situation where the validation occurs inside the User Control that it's
Any thoughts on what might be causing this?
TextBox contained in Form, Button contained in Form with
CausesValidation=False, TextBox.validating Event does not fire
Textbox contained in UserControl, Button contained in Form with
CausesValidation = False, TextBox.Validating Event does fire.