Rajesh Gajulapalle

Rajesh Gajulapalle

  • NA
  • 126
  • 1.1k

It is possible to give different Google API Key in ASP.NET?

Feb 5 2014 5:32 AM
I am using googlemaps.subgurim.net in my application,it is possible to set different GOOGLE API KEY to different users based on their logins.   
 web.config: <add key="googlemaps.subgurim.net" value="xxxxxxxxx"/> 
.aspx: <cc1:GMap ID="GMap1" runat="server" Height="805px" Width="800px" /> 
.aspx.cs: string sMapKey = ConfigurationManager.AppSettings["googlemaps.subgurim.net"]; 
GeoCode objAddress = new GeoCode();                     
  objAddress=Map.geoCodeRequest(newGLatLng(Convert.ToDouble(status.Rows[0][0]),Convert.ToDouble(status.Rows[0][1])), sMapKey);
 StringBuilder sb = new StringBuilder();
 if (objAddress.valid) {                
                         sb.Append(objAddress.Placemark.address.ToString());     
                                    lbladd.Text = sb.ToString(); }