Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any way to bypass Validating event when closing form?
Message
De
11/02/2008 15:43:29
 
 
À
11/02/2008 15:23:51
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Divers
Thread ID:
01291525
Message ID:
01291603
Vues:
7
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform