Web form validation vs object validation

Discussion in 'ASP .Net' started by Colin Basterfield, Nov 28, 2003.

  1. Hi,

    I have a web form which takes daily sales totals, both counts and monetary
    value and is done on a weekly basis, so on a Monday morning the User would
    enter these totals. Each total has a range, which at the lower end is >= 0
    and the upper limit is configurable, these totals are then submitted to a
    web service which posts them to a data store.

    The question is regarding validation, obviously I can validate on the web
    form using RangeValidator, and I was thinking of using an event to track
    which control had focus and then modify the ControlToValidate accordingly.
    So my first question would be how do you track on a web form which control
    has focus using an event?

    However perhaps a broader question would be: surely it would be better to
    simply submit the whole object which holds the totals, and return any error
    message, to the erring control, however that gets complicated if there is
    more than one error, this would involve the whole object to-ing and fro-ing
    between the web service and the web form?

    Any thoughts anyone?
    Many thanks
    Colin
     
    Colin Basterfield, Nov 28, 2003
    #1
    1. Advertising

  2. Colin Basterfield

    Tommy Guest

    1. You just create a RangeValidator for each control you want to
    validate on
    your webform. Why do you want to share one RangeValidator control?

    2. There is a validation summary control that will display all error
    messages
    of all the validation control on the client side.

    Could you explain your process flow further in detail? It seems that
    you could just do #1 and #2, and if it is successful, then your
    webform that submit the the data to the web service.

    Tommy,

    "Colin Basterfield" <> wrote in message news:<O0a#>...
    > Hi,
    >
    > I have a web form which takes daily sales totals, both counts and monetary
    > value and is done on a weekly basis, so on a Monday morning the User would
    > enter these totals. Each total has a range, which at the lower end is >= 0
    > and the upper limit is configurable, these totals are then submitted to a
    > web service which posts them to a data store.
    >
    > The question is regarding validation, obviously I can validate on the web
    > form using RangeValidator, and I was thinking of using an event to track
    > which control had focus and then modify the ControlToValidate accordingly.
    > So my first question would be how do you track on a web form which control
    > has focus using an event?
    >
    > However perhaps a broader question would be: surely it would be better to
    > simply submit the whole object which holds the totals, and return any error
    > message, to the erring control, however that gets complicated if there is
    > more than one error, this would involve the whole object to-ing and fro-ing
    > between the web service and the web form?
    >
    > Any thoughts anyone?
    > Many thanks
    > Colin
     
    Tommy, Nov 29, 2003
    #2
    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. Sumith Mathur
    Replies:
    0
    Views:
    2,233
    Sumith Mathur
    Sep 23, 2004
  2. OriginalBrownster

    string validation/ form validation

    OriginalBrownster, Aug 21, 2006, in forum: Python
    Replies:
    1
    Views:
    441
    Simon Forman
    Aug 21, 2006
  3. Replies:
    5
    Views:
    801
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Jun 12, 2007
  4. Grigory Temchenko
    Replies:
    0
    Views:
    341
    Grigory Temchenko
    Dec 28, 2008
  5. bnp
    Replies:
    4
    Views:
    348
Loading...

Share This Page