Welcome to Professional ASP.NET - Chris Love's Official Blog Sign in | Join | Help

Chris Love's Official ASP.NET Blog

Chris Love's Helpful tips, tricks and pragmatic development knowledge for the ASP.NET world.
Add to Technorati Favorites


ASP Insider
Data Validation - It seems no matter what the user......

One thing I have learned in my ten plus years of building web sites is that data needs to be valid.  If it is not valid, then the application could just blow up and your client will be mad at you/me.  In those ten years I have tried many, many things to make sure users put the right type of data in the fields we provide them.  Credit Cards, Phone Numbers, Money, you get the idea.  No matter what I do, they seem to somehow find a way to get past the javascript, specialized control, etc.

So this morning I woke up to three error messages, all from the same user trying to submit the same bad data to the application three times in succession.  First if you are a user of a web site and you get an error message that says the data you just entered is not valid, please review the data you entered and CORRECT IT!  I guess first you need to read the big red error message that is staring at you first to know the data you have in the form is not valid.

The person evidently had deleted the default value of $0 from an Infragisitcs Currency Control, so now it was NULL.  Dummy me had forgotten to enter a default value for NULL in the control properties, just the minimum of $0 and a default of $0.  I really thought this would solve that issue.  Well evidently the first user did not like seeing a value of $0 in the field and thought nothing would look better.  Now I don't fault the user for being themselves, I do however fault Infragistics for not making their control handle an empty string on this control when there is a minimum value set on the control and just making it 0.

I have now added a value for NULL and put the following code in my form processing method, which should help.  I just do not think I should have to go to these extrodinary lengths to ensure data is valid, this is getting way out of hand at times.  Sometimes there just seem to be applications where the users are just inept and don't read instructions.  This application seems to be one of those for me.

If IsNumeric(txtDollarAmount.ValueDouble) Then

   si.DollarAmount = txtDollarAmount.ValueDouble

Else

   si.DollarAmount = 0D

End If

Posted: Saturday, February 18, 2006 8:25 AM

by Chris Love
Filed under: ,

Comments

TomJohnsson said:

Yes, I agree. I have had a similar problem with the Infragistics calendar control displaying the word "null" to the user. It seems to me that an expensive product like IG would require less coding work for such common user errors. I agree with your comment "... I just do not think I should have to go to these extrodinary lengths to ensure data is valid, this is getting way out of hand at times ...".
# February 21, 2006 3:57 AM

Pirate96 said:

I understand your frustration with users. I have users that ignore flashing boxes that say they will destroy there computer if they click ok. they still do it. As far as related to IG sounds like they need to under go further testing and I would not spend money on their products untill their level of service and products rises to the level you exppect.
# February 21, 2006 10:25 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS