Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation in classes

Status
Not open for further replies.

Guru2B

Programmer
May 24, 2000
77
GB
Hi!

I am writing an IIS app(webclass) that (among other things) allows a user to add or modify customer information. It uses a function to write the add/modify HTML. If the function is passed a customer object, it displays the form populated with the information in the object. If there is no object, it presents a blank form.

I'd like to validate any information provided by the user (len > 0, no duplicates, etc) before storing it in the db. I'd also like to accomplish this on the server side.

In the event of an error in the user's input, I'd like to regenerate the same page with the data the user has entered and descriptions of the error(s) that exist (I do not want the user to lose all their entered data just because the class could not save one field because it failed validation).

I pondered setting error flags when setting the properties of the customer class, but wonder if that is a wise thing to do.

Any thoughts?


Guru2B

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top