How to pass address value using dropdown control in java script
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
venky nPosted Mar 12, 2015, 8:00 AM
Another one doubt this coding used in inherited(master into master page) master page cant working.the javascript cant work on the inherited master page.plz tel me sir how to use this coding for master page...
the inherited master page only one contentplaceholder so not working.normal asp page successfully executed sir.plz help me sir.
venky nPosted Mar 12, 2015, 7:02 AM
Lucky LaxmanPosted Mar 12, 2015, 6:41 AM
Please check the modified code ..
Thanks,
Lucky LaxmanPosted Mar 12, 2015, 6:39 AM
You given that code is wrong some Js error .
i modified all please go n check i am given code its work fine Happy Coding .
venky nPosted Mar 12, 2015, 5:54 AM
$(document).ready(function () {
$("#ddcity").change(function () {
var city = $("#ddcity").val();
var geocoder = new google.maps.Geocoder();
var com = city;
geocoder.geocode({ 'address': com }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var x = results[0].geometry.location.lat();
var y = results[0].geometry.location.lng();
var latlng = new google.maps.LatLng(x, y);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map($("#map-canvas").val(), myOptions);
var marker = new google.maps.Marker({
position: new google.maps.LatLng(x, y),
map: map,
title: com
});
var infowindow = new google.maps.InfoWindow({
content: com
});
infowindow.open(map, marker);
google.maps.event.addDomListener(window, 'load');
} else {
res.innerHTML = "Enter correct Details: " + status;
}
});
});
});
venky nPosted Mar 12, 2015, 5:45 AM
con means country another one textbox name but not used only used for city textbox.
venky nPosted Mar 12, 2015, 5:43 AM
the map can't visible the runtime.the same coding successfully executed in button control but not executing in dropdown control.plz help me sir
Lucky LaxmanPosted Mar 12, 2015, 5:34 AM
you can use like this if any error you get , replay the error.
$(document).ready(function () {
$("#ddcity").change(function () {
var city = $("#ddcity").val();
var geocoder = new google.maps.Geocoder();
// Their ( con ) this varaible where your getting i dont know . your drop down value come above given like that.
var com = city + "," + con;
geocoder.geocode({ 'address': com }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var x = results[0].geometry.location.lat();
var y = results[0].geometry.location.lng();
var latlng = new google.maps.LatLng(x, y);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map($("#map-canvas").val(), myOptions);
var marker = new google.maps.Marker({
position: new google.maps.LatLng(x, y),
map: map,
title: com
});
var infowindow = new google.maps.InfoWindow({
content: com
});
infowindow.open(map, marker);
google.maps.event.addDomListener(window, 'load');
} else {
res.innerHTML = "Enter correct Details: " + status;
}
});
});
});
if it use full like Me
Thanks,