Autocomplete Address using Google API Showing Error
I am using my Google API Key In Place of API Key
body {
font-family: Arial;
font-size: 10pt;
}
| Location | |
| Address | |
| Latitude | |
| Longitude | |
debugger
google.maps.event.addDomListener(window, 'load', function () {
var places = new google.maps.places.Autocomplete(document.getElementById('<%=txtLocation.ClientID %>'));
google.maps.event.addListener(places, 'place_changed', function () {
var place = places.getPlace();
document.getElementById('<%=txtAddress.ClientID %>').value = place.formatted_address;
document.getElementById('<%=txtLatitude.ClientID %>').value = place.geometry.location.lat();
document.getElementById('<%=txtLongitude.ClientID %>').value = place.geometry.location.lng();
});
});
protected void OnSubmit(object sender, EventArgs e)
{
string message = "Address: " + txtAddress.Text;
message += "\\nLatitude: " + txtLatitude.Text;
message += "\\nLongitude: " + txtLongitude.Text;
ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + message + "');", true);
}


Sachin SinghPosted Feb 6, 2021, 1:20 PM
Sachin SinghPosted Feb 6, 2021, 12:20 PM