In my application I want to fetch latitude and longitude based on the user input given using web method snippet provided by aspsnippets.com:
There are 7 textboxes and 1 Dropdownlist in my webform which are:
1- Unit/Street
2- Street_Name
3- City/Suburb
4- State
5- Post Code
6- Country(Dropdownlist)
7- Latitude
8- Longitude
In above fields except 7th and 8th all are based on user input and all are compulsary to input in order to get the Latitude and longitude textboxes filled with fetched results from API of google map which is taken from this article:
http://www.aspsnippets.com/Articles/Find-Co-ordinates-Latitude-and-Longitude-of-an-Address-Location-using-Google-Geocoding-API-in-ASPNet-using-C-and-VBNet.aspx
Now there might be case when it will return more than 1 rows, In this case the datarow/dataset should return the TOP 1 row and fill the data in Latitude and Longitude textboxes.
For your help I am providing the sample test data for the above fields:
1- Unit/Street "1"
2- Street_Name "Gandroo"
3- City/Suburb "Gungahlin"
4- State "ACT"
5- Post Code "2912"
6- Country(Dropdownlist) "Australia"
7- Latitude ---- Will be populated through Web method
8- Longitude ---- Will be populated through Web method