Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IsEmpty
Message
From
04/03/2010 17:08:03
 
 
To
04/03/2010 14:07:54
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Miscellaneous
Thread ID:
01452408
Message ID:
01452639
Views:
54
Thanks Tim!

Sorry I had to go on an emergency trip...

My issue I think is the fact that MM.NET uses the string.IsNullorEmpty() method. This is defined in .NET help -- a string is empty only if it is a NULL value, of course, and that it contains no characters (spaces are treated as characters even if that is all the string contains, which I think is wrong...

My case, in the real world, is when a user accidentally enters a space in a control and thinks it is empty and then saves the other changes on the form or business object. This causes problems if the control is a textbox and is a Required field. Empty is empty only in the eye of the beholder and that is the user, not the underlying logic in .NET.

I guess I will just always have to write my own rules instead of trying to save time with the BLG doing it. I have to have this in my case to match what the user defines as Empty. I wish or request that there is a way to specify that a string is also Empty if it contains only spaces.

I will have to use -- string.IsNullorEmpty(value.trim()) or mmType.IsEmpty(value.trim()) but will this fail if the string is NULL with the use of the .trim()? I will try that...

BLG uses the mmType.IsEmpty(value) or mmType.IsEmpty(value, bool) and neither will work in my test...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform