logo

Zipcode / CountryList / StateList Control Suite

Three of the most common things developers have to do with webforms in ASP.NET is provide a drop-down list box of states or countries, and check zipcodes and optionally fill in the city and state from an entered zipcode. This control suite does all three things.

The CountryList and StateList controls are self - populating, that is, there is no external datasource needed. These are servercontrols and can be dragged onto any WebForm from the Toolbox. They can also be set to generate an autopostback event and to preserve their selected items with ViewState.

The ZipCode Lookup Control contains a highly compressed database of all 42,698 US Cities, States and 5 digit zipcodes, right inside the .Net dll assembly, and enables fast zipcode lookups without any database or internet connection. It may be used both for ASP.NET applications as well as for Windows Forms - based applications.



Usage:

1) Simply place the CountryList.dll and / or the ZipcodeControl.dll in the /bin Folder of your ASP.NET application (you can also add CountryList to the GAC with "gacutil /i CountryList.dll" ).

2) REGISTER the component(s) by running the provided Register.exe utility and entering the 10 day Trial or Permanent License Key that was provided when you downloaded or purchased the controls. The controls will not function without a valid Trial or Permanent License Key installed in the Registry. If you started out with a registered Trial key and later purchase the control suite, you can use the Register.exe utility to enter your new Permanent key.

3) Then, in Visual Studio.NET, right click on the left - hand Toolbox area, Choose "Customize Toolbox", select the ".NET Framework" pane, navigate with the "Browse" button to select the DLL, and click "OK". The two control icons, StateList and CountryList, should both now appear on your toolbox. To add a Countrylist or StateList control to your web page, simply drag one of the controls from the Toolbox onto the Design surface of your WebForm. No further action is necessary. You can also set the Autopostback and Enable ViewState properties for each control in the Properties pane when either control is selected on the page.

The ZipCodeControl is not a servercontrol, but a utility library. It contains a highly compressed database of all 42,698 US Cities, States and 5 digit zipcodes. When the ZipCodeControl.ZipCodeLookup class is instantiated in your code, it decompresses this database into an indexed public in-memory DataTable, and also exposes two public methods, FindCityStateByZipCode, and FindZipCodeByCityState, along with three public ArrayList members, FoundZip, FoundCity, and FoundState. You can either use these methods, or you can access the DataTable property directly in your code and use the "Select" method to search or sort the database.

The provided ASP.NET Webform project illustrates how to place the instantiated library into an Application variable at startup, and use it in a web page. The most common use, which is that a user enters their Zip Code in a text box and tabs out to begin entering additional fields, will result in a postback and the matching City and State textboxes will be automatically populated. When you choose the "Find Zip by City and State" button, a DataGrid with all the matching City, State and Zipcode rows is populated from the control's public ArrayList members. An example of each of the StateList and CountryList controls is also provided on the sample Webform page. You can view a live sample:

See Live Sample page!


Download 10 Day Trial


Purchase ($9.95)