Is this possible??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All

I have several webforms that have ZipCode fields. What I'm wondering is if it's possible to have a user enter the ZipCode, and when they tab out of the field, then have a Script run that will do a lookup in a ZipCode table and then populate the City,State,County fields

The TextChanged property doesn't seem to work unless I post the form which I can't do since I've got more datafields to enter. Is this even possible to do in ASP.NET? If so, how would you suggest that I get this to work? I have code that works in the ZipCode TextChanged event that works, it just won't fire on a tab out of the field

Appreciate any thoughts anyone might have on this

Thanks...Bo
 
When you tried the TextChanged property did you have your AutoPostback as
True? You can still postback like this since you are going to be looking for
the TextChanged event.

--
-Stanley
http://www.glass-images.com
http://blogs.wwwcoder.com/darian1271



Bob McCormick said:
Hi All,

I have several webforms that have ZipCode fields. What I'm wondering is
if it's possible to have a user enter the ZipCode, and when they tab out of
the field, then have a Script run that will do a lookup in a ZipCode table
and then populate the City,State,County fields.
The TextChanged property doesn't seem to work unless I post the form which
I can't do since I've got more datafields to enter. Is this even possible
to do in ASP.NET? If so, how would you suggest that I get this to work? I
have code that works in the ZipCode TextChanged event that works, it just
won't fire on a tab out of the field.
 
Realistically, you are going to have to take a trip to the server, unless
you are going to download megs of data to facilitate the lookup. This is not
a problem with a tightly restricted form (ie, lookups in a business
territory), as the amount of data will be smaller.

You can either make the trip visible (postback) or invisible (XMLHTTP, or
similar), but a trip is a necessity. I have a collegue that loves XML HTTP
and a web service for this type of work. I am not overly thrilled with the
idea, as it limits the application to IE (at least for this functionality).

Unless you have a fat client, I would take a database trip to fill in the
info. The ViewState will hold the info already filled in when the postback
occurs. You can also break the form out into step 1 = zipcode, step 2 =
other info, which will make the postback less obtrusive.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
Bob McCormick said:
Hi All,

I have several webforms that have ZipCode fields. What I'm wondering is
if it's possible to have a user enter the ZipCode, and when they tab out of
the field, then have a Script run that will do a lookup in a ZipCode table
and then populate the City,State,County fields.
The TextChanged property doesn't seem to work unless I post the form which
I can't do since I've got more datafields to enter. Is this even possible
to do in ASP.NET? If so, how would you suggest that I get this to work? I
have code that works in the ZipCode TextChanged event that works, it just
won't fire on a tab out of the field.
 
Back
Top