Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug on Web control BindBack
Message
From
20/09/2004 14:06:01
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Bug on Web control BindBack
Miscellaneous
Thread ID:
00944109
Message ID:
00944109
Views:
63
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
Next
Reply
Map
View

Click here to load this message in the networking platform