468,121 Members | 1,420 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,121 developers. It's quick & easy.

Web form validation vs object validation

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
Nov 18 '05 #1
1 1460
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" <co**************@hotmail.com> wrote in message news:<O0**************@TK2MSFTNGP09.phx.gbl>...
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

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Weston C | last post: by
72 posts views Thread by Stephen Poley | last post: by
4 posts views Thread by TJS | last post: by
7 posts views Thread by Dave Wurtz | last post: by
9 posts views Thread by julie.siebel | last post: by
27 posts views Thread by Chris | last post: by
11 posts views Thread by Rik | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.