I was using Javascript code in .aspx.cs page but in javascript code i need to add one google API key url but am not understanding how to add it in .aspx.cs page can any one help me please...
Here is my code
.cs code
MSScriptControl.ScriptControl js = new MSScriptControl.ScriptControl();
function test(x)
{
var geocoder, location1;
var address = x;
geocoder = new GClientGeocoder();
geocoder.getLocations(address, function (response) {
if (!response || response.Status.code != 200){
}
else {
location1 = { lat: response.Placemark[0].Point.coordinates[1],
lon: response.Placemark[0].Point.coordinates[0],
address: response.Placemark[0].address
};
}
});
return location1.address;
}
");
string latlon = "17.3828683333333,78.412005";
object[] parms = new object[] { latlon };
string result = (string)js.Run("test", parms);
}
I need to use http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA7j_Q-rshuWkc8HyFI4V2HxQYPm-xtd00hTQOC0OXpAMO40FHAxT29dNBGfxqMPq5zwdeiDSHEPL89A URL in above javascript code and need result in result string
chandutalari
None
0 Points
6 Posts
How to get jqury result in .aspx.cs page
Jan 01, 2013 01:34 PM|LINK
Hi All,
I was using Javascript code in .aspx.cs page but in javascript code i need to add one google API key url but am not understanding how to add it in .aspx.cs page can any one help me please...
Here is my code
.cs code
MSScriptControl.ScriptControl js = new MSScriptControl.ScriptControl();
js.AllowUI = true;
js.Language = "JScript";
js.Reset();
js.AddCode(@"
function test(x)
{
var geocoder, location1;
var address = x;
geocoder = new GClientGeocoder();
geocoder.getLocations(address, function (response) {
if (!response || response.Status.code != 200){
}
else {
location1 = { lat: response.Placemark[0].Point.coordinates[1],
lon: response.Placemark[0].Point.coordinates[0],
address: response.Placemark[0].address
};
}
});
return location1.address;
}
");
string latlon = "17.3828683333333,78.412005";
object[] parms = new object[] { latlon };
string result = (string)js.Run("test", parms);
}
I need to use http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA7j_Q-rshuWkc8HyFI4V2HxQYPm-xtd00hTQOC0OXpAMO40FHAxT29dNBGfxqMPq5zwdeiDSHEPL89A URL in above javascript code and need result in result string
can any one help me
Thanks in advance
BrockAllen
All-Star
27574 Points
4912 Posts
MVP
Re: How to get jqury result in .aspx.cs page
Jan 01, 2013 02:43 PM|LINK
Check the latest docs -- IIRC google maps no longer require you to pass a key.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/