How to create a fast webrequest ?

T

thomasabcd

Hi,

During the user's registration I wan't to geo-code an address using
localsearchmaps.com/geo. For that purpose I use a webrequest like this:

string url = "http://www.localsearchmaps.com/geo/?street=" +
StreetNumber + "+" + StreetName + "&city=" + City +
"&country=DK&google2=1";

System.Net.WebRequest webRequest =
System.Net.HttpWebRequest.Create(url);
webRequest.Timeout = webRequest.Timeout * 10;
System.Net.WebResponse webResponse = webRequest.GetResponse();
System.IO.StreamReader reader = new
System.IO.StreamReader(webResponse.GetResponseStream());
string html = reader.ReadToEnd();
reader.Close();

I then pull out the information I need from the html-string.The problem
is, that it sometimes is a bit slow to request the information from the
Internet, and the user is therefore kept waiting. Is there a faster way
to do get the info from the net? Maybe an asynchronous call of some
sort?

TIA
 
G

Guest

I then pull out the information I need from the html-string.The problem
is, that it sometimes is a bit slow to request the information from the
Internet, and the user is therefore kept waiting. Is there a faster way
to do get the info from the net? Maybe an asynchronous call of some
sort?

Do you need the information right away?

Perhaps consider doing an Ajax call instead of a postback.
 
J

Joerg Jooss

Thus wrote Spam,
Do you need the information right away?

Perhaps consider doing an Ajax call instead of a postback.

I doubt a geo code is useful on the client side -- in which ase AJAX isn't
a viable option.

Why not batch the acquisition of these codes and perform them at some later
point in time?

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,282
Latest member
RoseannaBa

Latest Threads

Top