ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.[Solved] Google API AutoComplete not working inside ASP.Net UpdatePanel Partial PostBack<p>Hi <a class="username" rel="nauna"> nauna</a>,</p> <p>Refer below sample.</p> <p><span style="text-decoration: underline;"><strong>HTML</strong></span></p> <pre class="brush: html">&lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head runat=&#34;server&#34;&gt; &lt;title&gt;&lt;/title&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://maps.googleapis.com/maps/api/js?libraries=places&amp;sensor=false&amp;key=&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; $(function () { SetAutoComplete(); }); function SetAutoComplete() { $(&#39;&lt;%=txtfrom.ClientID%&gt;&#39;).focus(function () { var textbox1 = $(this).find(&#39;[id*=txtfrom]&#39;); var textbox2 = $(this).find(&#39;[id*=txtto]&#39;); ApplyAutoComplete(textbox1); ApplyAutoComplete(textbox2); }); } function ApplyAutoComplete(input) { google.maps.event.addDomListener(window, &#39;load&#39;, function () { var places; for (var i = 0; i &lt; input.length; i++) { var options = { types: [&#39;(regions)&#39;] }; places = new google.maps.places.Autocomplete(input[i], options); } google.maps.event.addListener(places, &#39;place_changed&#39;, function () { var place = places.getPlace(); var address = place.formatted_address; var mesg = &#34;Address: &#34; + address; }); }); } var source, destination; var directionsDisplay; var directionsService = new google.maps.DirectionsService(); function initialize(textBox) { var input = textBox; var options = { types: [&#39;(regions)&#39;] }; var autocomplete = new google.maps.places.Autocomplete(input, options); } google.maps.event.addDomListener(window, &#39;load&#39;, function () { initialize(document.getElementById(&#39;&lt;%=txtfrom.ClientID%&gt;&#39;)); initialize(document.getElementById(&#39;&lt;%=txtto.ClientID%&gt;&#39;)); directionsDisplay = new google.maps.DirectionsRenderer({ &#39;draggable&#39;: true }); }) var prm = Sys.WebForms.PageRequestManager.getInstance(); if (prm != null) { prm.add_endRequest(function (sender, e) { if (sender._postBackSettings.panelsToUpdate != null) { SetAutoComplete(); } }); }; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=&#34;form1&#34; runat=&#34;server&#34;&gt; &lt;div class=&#34;form-group col-md-2 padding2&#34;&gt; Origin ( City,ST ) &lt;asp:TextBox ID=&#34;txtfrom&#34; runat=&#34;server&#34; AutoPostBack=&#34;True&#34; OnTextChanged=&#34;change&#34;&gt;&lt;/asp:TextBox&gt; &lt;asp:Label ID=&#34;Label6&#34; runat=&#34;server&#34; Text=&#34;Origin is required&#34; CssClass=&#34;validation&#34; Visible=&#34;false&#34;&gt;&lt;/asp:Label&gt; &lt;asp:RequiredFieldValidator ID=&#34;RequiredFieldValidator3&#34; runat=&#34;server&#34; ErrorMessage=&#34;Origin is Required&#34; CssClass=&#34;validation&#34; SetFocusOnError=&#34;True&#34; ControlToValidate=&#34;txtfrom&#34; Display=&#34;Dynamic&#34; ValidationGroup=&#34;pl&#34;&gt;&lt;/asp:RequiredFieldValidator&gt; &lt;/div&gt; &lt;div class=&#34;form-group col-md-2 padding2&#34;&gt; Destination ( City,ST ) &lt;asp:TextBox ID=&#34;txtto&#34; runat=&#34;server&#34; AutoPostBack=&#34;True&#34;&gt;&lt;/asp:TextBox&gt; &lt;asp:Label ID=&#34;Llbldistance&#34; runat=&#34;server&#34; Text=&#34;&#34;&gt;&lt;/asp:Label&gt;&lt;br /&gt; &lt;asp:Label ID=&#34;Llblduration&#34; runat=&#34;server&#34; Text=&#34;&#34;&gt;&lt;/asp:Label&gt; &lt;asp:RequiredFieldValidator ID=&#34;RequiredFieldValidator4&#34; runat=&#34;server&#34; ErrorMessage=&#34;Destination is required&#34; CssClass=&#34;validation&#34; SetFocusOnError=&#34;True&#34; ControlToValidate=&#34;txtto&#34; Display=&#34;Dynamic&#34; ValidationGroup=&#34;pl&#34;&gt;&lt;/asp:RequiredFieldValidator&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;</pre> <p><span style="text-decoration: underline;"><strong>Screenshot</strong></span></p> <p><img src="https://imgur.com/DBvpdWE.gif" alt="" width="344" height="216" /></p>https://www.aspforums.net:443/Threads/866583/Solved-Google-API-AutoComplete-not-working-inside-ASPNet-UpdatePanel-Partial-PostBack/https://www.aspforums.net:443/Threads/866583/Solved-Google-API-AutoComplete-not-working-inside-ASPNet-UpdatePanel-Partial-PostBack/Mon, 03 Jun 2019 06:38:05 GMT