TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Autocomplete Google Place API
Hemlata Kushwaha
Aug 10
2015
Code
6.8
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<%@ Page Language=
"C#"
AutoEventWireup=
"true"
CodeFile=
"AutoCompleteAPI.aspx.cs"
Inherits=
"AutoCompleteAPI"
%>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head runat=
"server"
>
<title>Place Autocomplete Address Form</title>
<meta name=
"viewport"
content=
"initial-scale=1.0, user-scalable=no"
>
<meta charset=
"utf-8"
>
<link type=
"text/css"
rel=
"stylesheet"
href=
"https://fonts.googleapis.com/css?family=Roboto:300,400,500"
>
<script src=
"https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"
></script>
<script type=
"text/javascript"
>
// This example displays an address form, using the autocomplete feature
// of the Google Places API to help users fill in the information.
var placeSearch, autocomplete,country;
var componentForm = {
street_number:
'short_name'
,
route:
'long_name'
,
locality:
'long_name'
,
administrative_area_level_1:
'short_name'
,
country:
'long_name'
,
};
function changecountry() {
country = document.getElementById(
'ddlcountry'
).value;
if
(country ==
'all'
) {
autocomplete.setComponentRestrictions([]);
}
else
{
autocomplete.setComponentRestrictions({
'country'
: country });
}
}
function initialize() {
// Create the autocomplete object, restricting the search
// to geographical location types.
autocomplete =
new
google.maps.places.Autocomplete(
/** @type {HTMLInputElement} */
(document.getElementById(
'txtplace'
)),
{ types: [
'(cities)'
] });
changecountry();
// Set the country restriction based on user input.
// When the user selects an address from the dropdown,
// populate the address fields in the form.
google.maps.
event
.addListener(autocomplete,
'place_changed'
, function () {
fillInAddress();
});
}
// The START and END in square brackets define a snippet for our documentation:
// [START region_fillform]
function fillInAddress() {
// Get the place details from the autocomplete object.
var place = autocomplete.getPlace();
// Get each component of the address from the place details
// and fill the corresponding field on the form.
for
(var i = 0; i < place.address_components.length; i++) {
var addressType = place.address_components[i].types[0];
if
(componentForm[addressType]) {
if
(addressType ==
"locality"
) {
var val = place.address_components[i][componentForm[addressType]];
document.getElementById(
'txtlocality'
).value = val;
}
else
if
(addressType ==
"administrative_area_level_1"
) {
document.getElementById(
'txtState'
).value = place.address_components[i][componentForm[addressType]];
}
else
if
(addressType ==
"country"
) {
var val = place.address_components[i][componentForm[addressType]];
document.getElementById(
'txtCountry'
).value = val;
}
}
}
geolocate();
}
// [END region_fillform]
// [START region_geolocation]
// Bias the autocomplete object to the user's geographical location,
// as supplied by the browser's 'navigator.geolocation' object.
function geolocate() {
var place = autocomplete.getPlace();
//-----For Latitude
var lat = place.geometry.location.lat();
var Latsign =
''
;
var latitudeString;
var myLati = parseFloat(lat);
if
(myLati >= 0) {
Latsign =
"N"
;
}
else
{
myLati = -myLati;
Latsign =
"S"
;
}
latitudeString = convertDecimalToDeg(myLati);
document.getElementById(
'txtlatitude'
).value = latitudeString+Latsign;
//----For Longitude
var lang = place.geometry.location.lng();
var sign1 =
''
;
var longitudeString;
var myLangi = parseFloat(lang);
if
(myLangi >= 0) {
sign1 =
"E"
;
}
else
{
myLangi = -myLangi;
sign1 =
"W"
;
}
longitudeString = convertDecimalToDeg(myLangi);
document.getElementById(
'txtlongitude'
).value =longitudeString+sign1;
}
function convertDecimalToDeg(input) {
var myVar = parseFloat(input);
var myString =
''
;
var myvar1 = parseInt(myVar);
myVar = (myVar - myvar1) * 60;
var myVar2 = parseInt(myVar);
myVar = (myVar - myVar2) * 60;
var myVar3 = parseInt(myVar);
myString = myVar3;
if
(myVar3 < 10) {
myString =
"0"
+ myString;
}
myString = myVar2 +
":"
+ myString;
if
(myVar2 < 10) {
myString =
"0"
+ myString;
}
myString = myvar1 +
":"
+ myString;
if
(myvar1 < 10) {
myString =
"00"
+ myString;
}
else
if
(myvar1 < 100) {
myString =
"0"
+ myString;
}
return
myString;
}
// [END region_geolocation]
</script>
</head>
<body onload=
"initialize();"
>
<form id=
"form1"
runat=
"server"
>
<center>
<table border=
"1"
>
<tr><td colspan=
"2"
><h4 style=
"text-align:center"
>Find City, Sate, Latitude, Longitude </h4></td></tr>
<tr>
<td>
Country
</td>
<td>
<asp:DropDownList ID=
"ddlcountry"
runat=
"server"
onchange=
"changecountry()"
CssClass=
"activSelect"
TabIndex=
"11"
>
<asp:ListItem Text=
"Select Country"
Value=
"Select Country"
></asp:ListItem>
<asp:ListItem Text=
"Afghanistan"
Value=
"AF"
/>
<asp:ListItem Text=
"Åland Islands"
Value=
"AX"
/>
<asp:ListItem Text=
"Albania"
Value=
"AL"
/>
<asp:ListItem Text=
"Algeria"
Value=
"DZ"
/>
<asp:ListItem Text=
"American Samoa"
Value=
"AS"
/>
<asp:ListItem Text=
"Andorra"
Value=
"AD"
/>
<asp:ListItem Text=
"Angola"
Value=
"AO"
/>
<asp:ListItem Text=
"Anguilla"
Value=
"AI"
/>
<asp:ListItem Text=
"Antarctica"
Value=
"AQ"
/>
<asp:ListItem Text=
"Antigua and Barbuda"
Value=
"AG"
/>
<asp:ListItem Text=
"Argentina"
Value=
"AR"
/>
<asp:ListItem Text=
"Armenia"
Value=
"AM"
/>
<asp:ListItem Text=
"Aruba"
Value=
"AW"
/>
<asp:ListItem Text=
"Australia"
Value=
"AU"
/>
<asp:ListItem Text=
"Austria"
Value=
"AT"
/>
<asp:ListItem Text=
"Azerbaijan"
Value=
"AZ"
/>
<asp:ListItem Text=
"Bahamas"
Value=
"BS"
/>
<asp:ListItem Text=
"Bahrain"
Value=
"BH"
/>
<asp:ListItem Text=
"Bangladesh"
Value=
"BD"
/>
<asp:ListItem Text=
"Barbados"
Value=
"BB"
/>
<asp:ListItem Text=
"Belarus"
Value=
"BY"
/>
<asp:ListItem Text=
"Belgium"
Value=
"BE"
/>
<asp:ListItem Text=
"Belize"
Value=
"BZ"
/>
<asp:ListItem Text=
"Benin"
Value=
"BJ"
/>
<asp:ListItem Text=
"Bermuda"
Value=
"BM"
/>
<asp:ListItem Text=
"Bhutan"
Value=
"BT"
/>
<asp:ListItem Text=
"Bolivia, Plurinational State of"
Value=
"BO"
/>
<asp:ListItem Text=
"Bonaire, Sint Eustatius and Saba"
Value=
"BQ"
/>
<asp:ListItem Text=
"Bosnia and Herzegovina"
Value=
"BA"
/>
<asp:ListItem Text=
"Botswana"
Value=
"BW"
/>
<asp:ListItem Text=
"Bouvet Island"
Value=
"BV"
/>
<asp:ListItem Text=
"Brazil"
Value=
"BR"
/>
<asp:ListItem Text=
"British Indian Ocean Territory"
Value=
"IO"
/>
<asp:ListItem Text=
"Brunei Darussalam"
Value=
"BN"
/>
<asp:ListItem Text=
"Bulgaria"
Value=
"BG"
/>
<asp:ListItem Text=
"Burkina Faso"
Value=
"BF"
/>
<asp:ListItem Text=
"Burundi"
Value=
"BI"
/>
<asp:ListItem Text=
"Cambodia"
Value=
"KH"
/>
<asp:ListItem Text=
"Cameroon"
Value=
"CM"
/>
<asp:ListItem Text=
"Canada"
Value=
"CA"
/>
<asp:ListItem Text=
"Cape Verde"
Value=
"CV"
/>
<asp:ListItem Text=
"Cayman Islands"
Value=
"KY"
/>
<asp:ListItem Text=
"Central African Republic"
Value=
"CF"
/>
<asp:ListItem Text=
"Chad"
Value=
"TD"
/>
<asp:ListItem Text=
"Chile"
Value=
"CL"
/>
<asp:ListItem Text=
"China"
Value=
"CN"
/>
<asp:ListItem Text=
"Christmas Island"
Value=
"CX"
/>
<asp:ListItem Text=
"Cocos (Keeling) Islands"
Value=
"CC"
/>
<asp:ListItem Text=
"Colombia"
Value=
"CO"
/>
<asp:ListItem Text=
"Comoros"
Value=
"KM"
/>
<asp:ListItem Text=
"Congo"
Value=
"CG"
/>
<asp:ListItem Text=
"Congo, the Democratic Republic of the"
Value=
"CD"
/>
<asp:ListItem Text=
"Cook Islands"
Value=
"CK"
/>
<asp:ListItem Text=
"Costa Rica"
Value=
"CR"
/>
<asp:ListItem Text=
"Côte d'Ivoire"
Value=
"CI"
/>
<asp:ListItem Text=
"Croatia"
Value=
"HR"
/>
<asp:ListItem Text=
"Cuba"
Value=
"CU"
/>
<asp:ListItem Text=
"Curaçao"
Value=
"CW"
/>
<asp:ListItem Text=
"Cyprus"
Value=
"CY"
/>
<asp:ListItem Text=
"Czech Republic"
Value=
"CZ"
/>
<asp:ListItem Text=
"Denmark"
Value=
"DK"
/>
<asp:ListItem Text=
"Djibouti"
Value=
"DJ"
/>
<asp:ListItem Text=
"Dominica"
Value=
"DM"
/>
<asp:ListItem Text=
"Dominican Republic"
Value=
"DO"
/>
<asp:ListItem Text=
"Ecuador"
Value=
"EC"
/>
<asp:ListItem Text=
"Egypt"
Value=
"EG"
/>
<asp:ListItem Text=
"El Salvador"
Value=
"SV"
/>
<asp:ListItem Text=
"Equatorial Guinea"
Value=
"GQ"
/>
<asp:ListItem Text=
"Eritrea"
Value=
"ER"
/>
<asp:ListItem Text=
"Estonia"
Value=
"EE"
/>
<asp:ListItem Text=
"Ethiopia"
Value=
"ET"
/>
<asp:ListItem Text=
"Falkland Islands (Malvinas)"
Value=
"FK"
/>
<asp:ListItem Text=
"Faroe Islands"
Value=
"FO"
/>
<asp:ListItem Text=
"Fiji"
Value=
"FJ"
/>
<asp:ListItem Text=
"Finland"
Value=
"FI"
/>
<asp:ListItem Text=
"France"
Value=
"FR"
/>
<asp:ListItem Text=
"French Guiana"
Value=
"GF"
/>
<asp:ListItem Text=
"French Polynesia"
Value=
"PF"
/>
<asp:ListItem Text=
"French Southern Territories"
Value=
"TF"
/>
<asp:ListItem Text=
"Gabon"
Value=
"GA"
/>
<asp:ListItem Text=
"Gambia"
Value=
"GM"
/>
<asp:ListItem Text=
"Georgia"
Value=
"GE"
/>
<asp:ListItem Text=
"Germany"
Value=
"DE"
/>
<asp:ListItem Text=
"Ghana"
Value=
"GH"
/>
<asp:ListItem Text=
"Gibraltar"
Value=
"GI"
/>
<asp:ListItem Text=
"Greece"
Value=
"GR"
/>
<asp:ListItem Text=
"Greenland"
Value=
"GL"
/>
<asp:ListItem Text=
"Grenada"
Value=
"GD"
/>
<asp:ListItem Text=
"Guadeloupe"
Value=
"GP"
/>
<asp:ListItem Text=
"Guam"
Value=
"GU"
/>
<asp:ListItem Text=
"Guatemala"
Value=
"GT"
/>
<asp:ListItem Text=
"Guernsey"
Value=
"GG"
/>
<asp:ListItem Text=
"Guinea"
Value=
"GN"
/>
<asp:ListItem Text=
"Guinea-Bissau"
Value=
"GW"
/>
<asp:ListItem Text=
"Guyana"
Value=
"GY"
/>
<asp:ListItem Text=
"Haiti"
Value=
"HT"
/>
<asp:ListItem Text=
"Heard Island and McDonald Islands"
Value=
"HM"
/>
<asp:ListItem Text=
"Holy See (Vatican City State)"
Value=
"VA"
/>
<asp:ListItem Text=
"Honduras"
Value=
"HN"
/>
<asp:ListItem Text=
"Hong Kong"
Value=
"HK"
/>
<asp:ListItem Text=
"Hungary"
Value=
"HU"
/>
<asp:ListItem Text=
"Iceland"
Value=
"IS"
/>
<asp:ListItem Text=
"India"
Value=
"IN"
Selected=
"True"
/>
<asp:ListItem Text=
"Indonesia"
Value=
"ID"
/>
<asp:ListItem Text=
"Iran, Islamic Republic of"
Value=
"IR"
/>
<asp:ListItem Text=
"Iraq"
Value=
"IQ"
/>
<asp:ListItem Text=
"Ireland"
Value=
"IE"
/>
<asp:ListItem Text=
"Isle of Man"
Value=
"IM"
/>
<asp:ListItem Text=
"Israel"
Value=
"IL"
/>
<asp:ListItem Text=
"Italy"
Value=
"IT"
/>
<asp:ListItem Text=
"Jamaica"
Value=
"JM"
/>
<asp:ListItem Text=
"Japan"
Value=
"JP"
/>
<asp:ListItem Text=
"Jersey"
Value=
"JE"
/>
<asp:ListItem Text=
"Jordan"
Value=
"JO"
/>
<asp:ListItem Text=
"Kazakhstan"
Value=
"KZ"
/>
<asp:ListItem Text=
"Kenya"
Value=
"KE"
/>
<asp:ListItem Text=
"Kiribati"
Value=
"KI"
/>
<asp:ListItem Text=
"Korea, Democratic People's Republic of"
Value=
"KP"
/>
<asp:ListItem Text=
"Korea, Republic of"
Value=
"KR"
/>
<asp:ListItem Text=
"Kuwait"
Value=
"KW"
/>
<asp:ListItem Text=
"Kyrgyzstan"
Value=
"KG"
/>
<asp:ListItem Text=
"Lao People's Democratic Republic"
Value=
"LA"
/>
<asp:ListItem Text=
"Latvia"
Value=
"LV"
/>
<asp:ListItem Text=
"Lebanon"
Value=
"LB"
/>
<asp:ListItem Text=
"Lesotho"
Value=
"LS"
/>
<asp:ListItem Text=
"Liberia"
Value=
"LR"
/>
<asp:ListItem Text=
"Libya"
Value=
"LY"
/>
<asp:ListItem Text=
"Liechtenstein"
Value=
"LI"
/>
<asp:ListItem Text=
"Lithuania"
Value=
"LT"
/>
<asp:ListItem Text=
"Luxembourg"
Value=
"LU"
/>
<asp:ListItem Text=
"Macao"
Value=
"MO"
/>
<asp:ListItem Text=
"Macedonia, the former Yugoslav Republic of"
Value=
"MK"
/>
<asp:ListItem Text=
"Madagascar"
Value=
"MG"
/>
<asp:ListItem Text=
"Malawi"
Value=
"MW"
/>
<asp:ListItem Text=
"Malaysia"
Value=
"MY"
/>
<asp:ListItem Text=
"Maldives"
Value=
"MV"
/>
<asp:ListItem Text=
"Mali"
Value=
"ML"
/>
<asp:ListItem Text=
"Malta"
Value=
"MT"
/>
<asp:ListItem Text=
"Marshall Islands"
Value=
"MH"
/>
<asp:ListItem Text=
"Martinique"
Value=
"MQ"
/>
<asp:ListItem Text=
"Mauritania"
Value=
"MR"
/>
<asp:ListItem Text=
"Mauritius"
Value=
"MU"
/>
<asp:ListItem Text=
"Mayotte"
Value=
"YT"
/>
<asp:ListItem Text=
"Mexico"
Value=
"MX"
/>
<asp:ListItem Text=
"Micronesia, Federated States of"
Value=
"FM"
/>
<asp:ListItem Text=
"Moldova, Republic of"
Value=
"MD"
/>
<asp:ListItem Text=
"Monaco"
Value=
"MC"
/>
<asp:ListItem Text=
"Mongolia"
Value=
"MN"
/>
<asp:ListItem Text=
"Montenegro"
Value=
"ME"
/>
<asp:ListItem Text=
"Montserrat"
Value=
"MS"
/>
<asp:ListItem Text=
"Morocco"
Value=
"MA"
/>
<asp:ListItem Text=
"Mozambique"
Value=
"MZ"
/>
<asp:ListItem Text=
"Myanmar"
Value=
"MM"
/>
<asp:ListItem Text=
"Namibia"
Value=
"NA"
/>
<asp:ListItem Text=
"Nauru"
Value=
"NR"
/>
<asp:ListItem Text=
"Nepal"
Value=
"NP"
/>
<asp:ListItem Text=
"Netherlands"
Value=
"NL"
/>
<asp:ListItem Text=
"New Caledonia"
Value=
"NC"
/>
<asp:ListItem Text=
"New Zealand"
Value=
"NZ"
/>
<asp:ListItem Text=
"Nicaragua"
Value=
"NI"
/>
<asp:ListItem Text=
"Niger"
Value=
"NE"
/>
<asp:ListItem Text=
"Nigeria"
Value=
"NG"
/>
<asp:ListItem Text=
"Niue"
Value=
"NU"
/>
<asp:ListItem Text=
"Norfolk Island"
Value=
"NF"
/>
<asp:ListItem Text=
"Northern Mariana Islands"
Value=
"MP"
/>
<asp:ListItem Text=
"Norway"
Value=
"NO"
/>
<asp:ListItem Text=
"Oman"
Value=
"OM"
/>
<asp:ListItem Text=
"Pakistan"
Value=
"PK"
/>
<asp:ListItem Text=
"Palau"
Value=
"PW"
/>
<asp:ListItem Text=
"Palestinian Territory, Occupied"
Value=
"PS"
/>
<asp:ListItem Text=
"Panama"
Value=
"PA"
/>
<asp:ListItem Text=
"Papua New Guinea"
Value=
"PG"
/>
<asp:ListItem Text=
"Paraguay"
Value=
"PY"
/>
<asp:ListItem Text=
"Peru"
Value=
"PE"
/>
<asp:ListItem Text=
"Philippines"
Value=
"PH"
/>
<asp:ListItem Text=
"Pitcairn"
Value=
"PN"
/>
<asp:ListItem Text=
"Poland"
Value=
"PL"
/>
<asp:ListItem Text=
"Portugal"
Value=
"PT"
/>
<asp:ListItem Text=
"Puerto Rico"
Value=
"PR"
/>
<asp:ListItem Text=
"Qatar"
Value=
"QA"
/>
<asp:ListItem Text=
"Réunion"
Value=
"RE"
/>
<asp:ListItem Text=
"Romania"
Value=
"RO"
/>
<asp:ListItem Text=
"Russian Federation"
Value=
"RU"
/>
<asp:ListItem Text=
"Rwanda"
Value=
"RW"
/>
<asp:ListItem Text=
"Saint Barthélemy"
Value=
"BL"
/>
<asp:ListItem Text=
"Saint Helena, Ascension and Tristan da Cunha"
Value=
"SH"
/>
<asp:ListItem Text=
"Saint Kitts and Nevis"
Value=
"KN"
/>
<asp:ListItem Text=
"Saint Lucia"
Value=
"LC"
/>
<asp:ListItem Text=
"Saint Martin (French part)"
Value=
"MF"
/>
<asp:ListItem Text=
"Saint Pierre and Miquelon"
Value=
"PM"
/>
<asp:ListItem Text=
"Saint Vincent and the Grenadines"
Value=
"VC"
/>
<asp:ListItem Text=
"Samoa"
Value=
"WS"
/>
<asp:ListItem Text=
"San Marino"
Value=
"SM"
/>
<asp:ListItem Text=
"Sao Tome and Principe"
Value=
"ST"
/>
<asp:ListItem Text=
"Saudi Arabia"
Value=
"SA"
/>
<asp:ListItem Text=
"Senegal"
Value=
"SN"
/>
<asp:ListItem Text=
"Serbia"
Value=
"RS"
/>
<asp:ListItem Text=
"Seychelles"
Value=
"SC"
/>
<asp:ListItem Text=
"Sierra Leone"
Value=
"SL"
/>
<asp:ListItem Text=
"Singapore"
Value=
"SG"
/>
<asp:ListItem Text=
"Sint Maarten (Dutch part)"
Value=
"SX"
/>
<asp:ListItem Text=
"Slovakia"
Value=
"SK"
/>
<asp:ListItem Text=
"Slovenia"
Value=
"SI"
/>
<asp:ListItem Text=
"Solomon Islands"
Value=
"SB"
/>
<asp:ListItem Text=
"Somalia"
Value=
"SO"
/>
<asp:ListItem Text=
"South Africa"
Value=
"ZA"
/>
<asp:ListItem Text=
"South Georgia and the South Sandwich Islands"
Value=
"GS"
/>
<asp:ListItem Text=
"South Sudan"
Value=
"SS"
/>
<asp:ListItem Text=
"Spain"
Value=
"ES"
/>
<asp:ListItem Text=
"Sri Lanka"
Value=
"LK"
/>
<asp:ListItem Text=
"Sudan"
Value=
"SD"
/>
<asp:ListItem Text=
"Suriname"
Value=
"SR"
/>
<asp:ListItem Text=
"Svalbard and Jan Mayen"
Value=
"SJ"
/>
<asp:ListItem Text=
"Swaziland"
Value=
"SZ"
/>
<asp:ListItem Text=
"Sweden"
Value=
"SE"
/>
<asp:ListItem Text=
"Switzerland"
Value=
"CH"
/>
<asp:ListItem Text=
"Syrian Arab Republic"
Value=
"SY"
/>
<asp:ListItem Text=
"Taiwan, Province of China"
Value=
"TW"
/>
<asp:ListItem Text=
"Tajikistan"
Value=
"TJ"
/>
<asp:ListItem Text=
"Tanzania, United Republic of"
Value=
"TZ"
/>
<asp:ListItem Text=
"Thailand"
Value=
"TH"
/>
<asp:ListItem Text=
"Timor-Leste"
Value=
"TL"
/>
<asp:ListItem Text=
"Togo"
Value=
"TG"
/>
<asp:ListItem Text=
"Tokelau"
Value=
"TK"
/>
<asp:ListItem Text=
"Tonga"
Value=
"TO"
/>
<asp:ListItem Text=
"Trinidad and Tobago"
Value=
"TT"
/>
<asp:ListItem Text=
"Tunisia"
Value=
"TN"
/>
<asp:ListItem Text=
"Turkey"
Value=
"TR"
/>
<asp:ListItem Text=
"Turkmenistan"
Value=
"TM"
/>
<asp:ListItem Text=
"Turks and Caicos Islands"
Value=
"TC"
/>
<asp:ListItem Text=
"Tuvalu"
Value=
"TV"
/>
<asp:ListItem Text=
"Uganda"
Value=
"UG"
/>
<asp:ListItem Text=
"Ukraine"
Value=
"UA"
/>
<asp:ListItem Text=
"United Arab Emirates"
Value=
"AE"
/>
<asp:ListItem Text=
"United Kingdom"
Value=
"GB"
/>
<asp:ListItem Text=
"United States"
Value=
"US"
/>
<asp:ListItem Text=
"United States Minor Outlying Islands"
Value=
"UM"
/>
<asp:ListItem Text=
"Uruguay"
Value=
"UY"
/>
<asp:ListItem Text=
"Uzbekistan"
Value=
"UZ"
/>
<asp:ListItem Text=
"Vanuatu"
Value=
"VU"
/>
<asp:ListItem Text=
"Venezuela, Bolivarian Republic of"
Value=
"VE"
/>
<asp:ListItem Text=
"Viet Nam"
Value=
"VN"
/>
<asp:ListItem Text=
"Virgin Islands, British"
Value=
"VG"
/>
<asp:ListItem Text=
"Virgin Islands, U.S."
Value=
"VI"
/>
<asp:ListItem Text=
"Wallis and Futuna"
Value=
"WF"
/>
<asp:ListItem Text=
"Western Sahara"
Value=
"EH"
/>
<asp:ListItem Text=
"Yemen"
Value=
"YE"
/>
<asp:ListItem Text=
"Zambia"
Value=
"ZM"
/>
<asp:ListItem Text=
"Zimbabwe"
Value=
"ZW"
/>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Place
</td>
<td>
<asp:TextBox ID=
"txtplace"
runat=
"server"
Placeholder=
"Enter your address"
onchange=
"fillInAddress()"
></asp:TextBox>
</td>
</tr>
<tr>
<td>
City
</td>
<td colspan=
"3"
>
<asp:TextBox ID=
"txtlocality"
runat=
"server"
></asp:TextBox>
</td>
</tr>
<tr>
<td>
State
</td>
<td
class
=
"slimField"
>
<asp:TextBox ID=
"txtState"
runat=
"server"
></asp:TextBox>
</td>
</tr>
<tr>
<td>
Country
</td>
<td colspan=
"3"
>
<asp:TextBox ID=
"txtCountry"
runat=
"server"
></asp:TextBox>
</td>
</tr>
<tr>
<td>
Latitude
</td>
<td>
<asp:TextBox ID=
"txtlatitude"
runat=
"server"
></asp:TextBox>
</td>
</tr>
<tr>
<td>Logitude</td>
<td>
<asp:TextBox ID=
"txtlongitude"
runat=
"server"
></asp:TextBox>
</td>
</tr>
</table>
</div>
</center>
</form>
</body>
</html>
ASP.NET
Find Latitude and Longitude
Google Place API