Form input and validating

S

Seb

I'm trying to parse a form. The way I go about it now is that I simply
submit the form and use tryparse and assign the values to my entity
classes.

The problem is that I end up with a ton of if-statements like the one
below.


if(TryParse(...))
{
//assign
}
else
{
//report error
}

....
....

if(no errors)
{
//submit
}
else
{
//report errors
}


1. question: Is this really the best way to go about it? Using if
statements along with TryParse
Furthere more since I'm using mask extenders the submitted result
might be _:_:_ which will make the if statement even more complex.


2. How can I handle the my errors in a smart way? and if there are
errors not submit?


Can I somehow take advantage of a formview ?

best regards,
seb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top