Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bug on Web control BindBack
Message
De
20/09/2004 14:06:01
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Bug on Web control BindBack
Divers
Thread ID:
00944109
Message ID:
00944109
Vues:
62
Kevin,
Adding the IsRequired property to text boxes doesn’t do anything to address the full problem of incorrect type data being entered by a user. It only half helps where Null is not allowed.

I still maintain that on bindback, type validation errors MUST trigger the failure of data updates in the bizobj.

Example: Text box on web page bound to a datetime field with IsRequired set to true. User enters the values “1234567”. The warning Icon shows with the message “String was not recognized as a valid DateTime“ but the Business Object updates with no errors. The resulting date in the dataset is NULL or unchanged while the user is looking at a page with “1234567” on the screen. The warning icon helps but I MUST know programmatically if all rules past. And, in this situation there is no way for the bizobj to validate “1234567” because the bindback never could fill the datatime field with this erroneous value in the first place. Thus, no way to check type errors in the bizobj!!

I subclassed the bindback and added code that checks for an error message on bincback and if not empty calls the page.AddBrokenRuleForControl(Me, fieldName, Me.ErrorMessage)

Another way to solve the problem would be to use client side date validation however a solid framework should cause updates to fail anytime a user enters invalid data.

This issue is not that the field is required, that is one scenario, rather it is that TYPE errors due to invalid input can never be validated in bizobjs, they get validated on BindBack and when the type conversion from string to the datatable column type fails, the UPDATE in the bizobj must also fail!!


Terry Carroll
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform