I cant browse the google map page as it shows error "key authentication" 
and How can i inilize <literal control in javascript to pass value on 
pageLoad() for google map

*.aspx CODE :*

<script 
src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<key>=false"
type="text/javascript"></script>
<script type="text/javascript">
var map;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));

var lat =<asp:Literal ID="ltrLat" runat="server"/>;
var lng =<asp:Literal ID="ltrLng" runat="server"/>;

var center = new GLatLng(lat, lng);

map.setCenter(center, 10);
map.setUIToDefault();

var marker = new GMarker(center);
map.addOverlay(marker);
marker.openInfoWindow("Here");
}
}
</script>
<div id="map" style="width: 500px; height: 500px"></div>

*
*

*.cs CODE:*


protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{

Literal ltrLat = (Literal)FindControl("ltrLat");
Literal ltrLng = (Literal)FindControl("ltrLng");

ltrLat.Text ="71";
ltrLng.Text = "0";

}

*ERROR:*
Server Error in '/' Application.
------------------------------
*Object reference not set to an instance of an object.*

*Description: An unhandled exception occurred during the execution of the 
current web request. Please review the stack trace for more information 
about the error and where it originated in the code. 

Exception Details: System.NullReferenceException: Object reference not set 
to an instance of an object.

Source Error: 

*

Line 20:                 decimal al = 76;
Line 21:                 decimal la = 5;Line 22: ltrLat.Text = al.ToString(); 
Line 23:                 ltrLng.Text = la.ToString();
Line 24:             }

*
Source File: 
C:\Users\madiha.rahman\Desktop\OOZEKI\Ujala\UjalaWeb\UjalaWeb\AdminPanel\Google.aspx.cs
    
Line: 22  *

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-maps-api/-/8iE_iUA7VZgJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to