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
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