Form input and validating

Discussion in 'ASP .Net' started by Seb, Jul 28, 2008.

  1. Seb

    Seb Guest

    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
    Seb, Jul 28, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thierry

    validating input from the form

    Thierry, Nov 10, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    300
    William F. Robertson, Jr.
    Nov 10, 2003
  2. Thierry
    Replies:
    1
    Views:
    1,268
    S. Justin Gengo
    Nov 11, 2003
  3. darrel
    Replies:
    1
    Views:
    457
    darrel
    Jun 24, 2004
  4. Replies:
    2
    Views:
    5,909
  5. Paul D.Smith

    Validating FORM input problem

    Paul D.Smith, Sep 15, 2004, in forum: HTML
    Replies:
    11
    Views:
    636
    Mark Parnell
    Sep 16, 2004
Loading...

Share This Page