В API Google v3 они показывают пример, который включает в себя следующее:
function fillInAddress() {
// Get the place details from the autocomplete object.
var place = autocomplete.getPlace();
for (var component in componentForm) {
document.getElementById(component).value = '';
document.getElementById(component).disabled = false;
}
// 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]) {
var val = place.address_components[i][componentForm[addressType]];
document.getElementById(addressType).value = val;
}
}
}
Однако в ASP.NET необходимо использовать формат document.getElementById ("<% = controlname.ClientID%>")
Как создать синтаксис в fillInAddress () выше, чтобы передать объект 'component' и создать правильный синтаксис, чтобы эта работа работала? Спасибо