I'm moving from ASP to ASP.NET and I am using C# to write the objects
that the web forms will interact.

I want to know how do most of you test your data before submitting it to
the database?

For example, say that username in the user object is modified but the
new username is already in the database.  How would you notify the web
form from the user object that the username is already used?

Couple possibilities...

**
Should I use a "IsUserDataValid()" function that would throw an
exception for each error that the user can have? 

This would be ok, but it seems that I would need to have many roundtrips
to fix the many possible errors that could be found because only one
exception would be thrown per roundtrip.
**
Or would the better idea be to have a validation function for each user
attribute and call each of those and using the try/catch to find the
exceptions?

This would be fine, but it requires the developer to call many functions
to test the input before they could call the user.saveProperties()
function.  What if they forget one?
**

I am leaning towards the second idea myself because the developer must
know what attributes they are saving anyways, and it can find all the
errors in one trip and throw an exception for each of them.

I just want to state that I do not want to use the input field
validators.

Thanks for sharing your experience...

Rick.


---
You are currently subscribed to dotnet as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search
Subscription Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/


Reply via email to