i converting address in latitude , longitude.
here code
<script type="text/javascript"> function codeaddress() { if (page_clientvalidate()) { var address = $(".hno").val() + " " + $(".address").val() + "," + $(".city").val(); try { // fetch lattitude , logtittude using google map var geocoder = new google.maps.geocoder(); geocoder.geocode({ 'address': address }, function (results, status) { if (status === google.maps.geocoderstatus.ok) { console.log(results[0]); var location = results[0].geometry.location; $('[id*=hdnlat]').val(location.lat()); $('[id*=hdnlng]').val(location.lng()); javascript: __dopostback('cmiddle1$btnupdate', ''); } else { alert("please putt address info correctly"); } }); return false; } catch (err) { alert(err); } } } </script> and here link button
<asp:linkbutton id="btnupdate" runat="server" cssclass="btn" text="submit" causesvalidation="true" validationgroup="eregister" onclientclick="return codeaddress();"></asp:linkbutton> and onclick event declared when page prerender
this.btnupdate.click += new system.eventhandler(this.btnupdate_click); i alert latitude , longitude before __dopostback , alert works fine. __dopostback not working .
Comments
Post a Comment