Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any way to bypass Validating event when closing form?
Message
From
11/02/2008 15:43:29
 
 
To
11/02/2008 15:23:51
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01291525
Message ID:
01291603
Views:
8
>When I tab out of the text box, the validation code does not run. But when I tab back into it, it does! Any ideas about what could be causing this?

Not sure of your specific scenario but, in general, the trick is in remembering that the validation of a control that is *losing* focus only occurs if the control *receiving* the focus has 'CausesValidation' set to true. So, for example, you could tab through a whole bunch of controls with CausesValidation set to false and the validation for all of them will only fire when a control with 'CausesValidation' set to true receives focus...

Given the above I'd hazard a guess that the control that doesn't initially validate has CausesValidation true and the control that you tab to (and back from) has it set false - so, in effect, the first control is causing its own validation to fire

Hope this isn't too confusing (I've confused myself <s>)
Regards,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform