我试图在伙伴关系中增加一个 go图。 净儿童页(有主页)。 地图上的信息似乎从山洞中排出,但我看不到什么。 当我击中神学院的F12时,我可以看到,我的四分之四已经填满了有关地图的许多其他干.和数据。
我为何看不出任何想法?
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Contact.aspx.cs" Inherits="CentralWebsite.Contact" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<style type="text/css">
.style1
{
width: 317px;
}
</style>
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?key=mykey=false">
</script>
<script type="text/javascript">
function initialize() {
var myOptions = {
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
alert("alert " + document.getElementById("map_canvas"));
}
</script>
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<table style="width: 100%;">
<tr>
<td class="style1">
<h1>Telephone: 01709</h1>
<h1>Address</h1>
<h3></h3>
<h3>Rotherham</h3>
<h3>South Yorkshire</h3>
<h3>S60 1PP</h3>
</td>
<td>
<div id="map_canvas" style="width:100%; height:100%">
map should go here
</div>
</td>
</tr>
</table>
</asp:Content>
我称之为初始功能,把这一功能作为主页的上载特性如下:
public partial class Contact : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
HtmlGenericControl myBody = (HtmlGenericControl)Master.FindControl("myBody");
myBody.Attributes.Add("onload", "initialize()");
}
}
Many thanks
页: 1