Re: Firing server object/web service from a client validation...

From: Peter Blum (PLBlum_at_Blum.info)
Date: 02/06/04


Date: Fri, 6 Feb 2004 13:32:54 -0500

First, I notice that you cross posted. Please don't do that as we cannot
follow all the responses elsewhere and may be wasting our time replying when
you already have a satisfactory response from another newsgroup.

You can write a CustomValidator to do this work. Internally the
customvalidator (and all validators) hook up to the onchange event of a
textbox. If you intend to maintain this validation on the client-side, it
may be very inefficient as you would have to provide a javascript
representation of all zip codes. That could make for a huge page. In this
case, I would recommend posting back to the server to do the work. Another
suggestion is to simply validate the pattern is ##### or #####-####. You can
use a RegularExpressionValidator to do this. Microsoft has even supplied a
regular expression for you in the property editor for the Expression
property.

--- Peter Blum
www.PeterBlum.com
Email: PLBlum@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"arc" <arc@hotmail.com> wrote in message
news:uNQmCuA7DHA.3648@TK2MSFTNGP11.phx.gbl...
> I have a server object that performs zipcode validation based on zipcode
> entered in the web form.
> Ideally this should work as follows:
> Once the zip code is entered in the edit box it should validate the
> entry with this server object before moving to enter state in the next
> dropdown field.
>
> - What is the event by which we can do this for the edit box? (OnBlur
doesnt
> seem to capture the text though it fires up the server object)
> - This works fine when the validation is performed at the server level but
> user has to wait until the submit button is pressed, this is not feasible
> here.
>
> Thanks Much,
> Arc
>
>


Loading