3 Comments
jQuery

I have recently stumbled upon an article about address resolving with Pro6PP from a Dutch ecommerce magazine:

The Pro6PP project had my attention due to the low license fees.

So I signed up at Pro6PP for a free 2 months test account.

after that I created an http handler(autocompleteaddress.ashx.cs) which I can use with jQuery.

autocompleteaddress.ashx.cs (3.35 kb)

My demo.aspx file looked like this:

[more]
Zipcode :

Address :


City :


I left out the validators for readability concerns. All there was left for me to do is add jQuery which is best to be used trough a CDN (Content Delivery Network) from Google

(you should read this post on stackoverflow if you don’t know why you should use the Google CDN)

so add a reference to the jQuery lib on Google’s CDN:

https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js

Here is the jQuery that makes sure that the autocompleteaddress.ashx file fires:

 

Good luck!

p.s. You can get a simple custom Ajax loading animated gif from http://ajaxload.info/

Edit 7 september 2010: I have made a change to the ashx's last part:

xdoc.AddFirst(new XElement("adresses", address));
context.Response.Clear();
context.Response.ContentType = "text/xml";
context.Response.Charset = "UTF-8";
context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
context.Response.Cache.SetAllowResponseInBrowserHistory(true);
context.Response.Write("<?xml  version=\"1.0\" encoding=\"utf-8\" ?>");
context.Response.Write(System.Environment.NewLine);
context.Response.Write(xdoc.ToString());
context.Response.Write(System.Environment.NewLine);
//context.Response.Flush();
//context.Response.Close();
context.Response.End();

 

kick it on DotNetKicks.com Shout it

Pin on pinterest Plus on Googleplus Post on LinkedIn

Comments

Comment by Anil

Hi I have implemented the same example but didn't get the result.
Can you create the demo with c# code behind not the jQuery.
Thanks.
Anil

Anil
Comment by JP Hellemons

@Anil, What result do you get then when you debug and step into it :)

Comment by Anil

I have download the autocomplete.js file from the Pro6PP. This file gives me the error.
I want the sample application. Can you give me your application sample that you explain above.
I think i miss some script source.

Anil