Google Place Autocomplete not working in ASP.Net UpdatePanel after partial PostBack

Last Reply 3 months ago By dharmendr

Posted 3 months ago

hello,

i have this google place api it works fine,

i have textbox and a button inside the updated panel when i click button after partial post textbox deos not load javascript to show the google places

pelase advice

<script type="text/javascript">
    $(function () {
        $("div[class=mloadpost]").each(function () {
            var textbox1 = $(this).find('[id*=txtmultistopload]');
           
            ApplyAutoComplete(textbox1);
           
        });
    });
    function ApplyAutoComplete(input) {
        google.maps.event.addDomListener(window, 'load', function () {
            var places;
            for (var i = 0; i < input.length; i++) {
                var options = { types: ['(regions)'] };
                places = new google.maps.places.Autocomplete(input[i], options);
            }
            google.maps.event.addListener(places, 'place_changed', function () {
                var place = places.getPlace();
                var address = place.formatted_address;
                var mesg = "Address: " + address;
            });
        });
    }
</script>