Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Web form validation vs object validation

Reply
Thread Tools

Web form validation vs object validation

 
 
Colin Basterfield
Guest
Posts: n/a
 
      11-28-2003
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


 
Reply With Quote
 
 
 
 
Tommy
Guest
Posts: n/a
 
      11-29-2003
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" <(E-Mail Removed)> wrote in message news:<O0a#(E-Mail Removed)>...
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A form validation library with javascript validation Grigory Temchenko Python 0 12-28-2008 08:38 PM
string validation/ form validation OriginalBrownster Python 1 08-21-2006 01:50 AM
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
Struts validation for combine form fields validation Sumith Mathur Java 0 09-23-2004 06:26 PM
Form Validation Problem...Persisiting form fields on validation failure. bnp Javascript 4 05-12-2004 12:16 PM



Advertisments