title: Google Map will not display in ASP.NET Master Page
body: <p>I am trying to display a simple map in an ASP.NET page that has a Master Page. Everything works fine when I put the code in a static HTML page but nothing displays when using asp.net not even an error. When comparing the request/response in fiddler I can see that google is not sending any images back when using asp.net master page.</p>
  
  <p>Here's my client side code (I can hit a break point here):</p>
  
  <pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"&gt;
  &lt;meta name="viewport" content="initial-scale=1.0, user-scalable=no" /&gt;
      &lt;style type="text/css"&gt;
        html { height: 100% }
        body { height: 100%; margin: 0; padding: 0 }
        #map_canvas { height: 100%; background-color:#eeeeee;}
      &lt;/style&gt;
  
      &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          function initialize() {
              var latlng = new google.maps.LatLng(-34.397, 150.644);
              var myOptions = {
                  zoom: 8,
                  center: latlng,
                  mapTypeId: google.maps.MapTypeId.ROADMAP
              };
              var mapDiv = document.getElementById("map_canvas");
              var map = new google.maps.Map(mapDiv, myOptions);
                  }
  
      &lt;/script&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server"&gt;
      &lt;div id="map_canvas" style="width:100%; height:100%"&gt;&lt;/div&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>I call the script from the server:</p>
  
  <pre><code>Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
  Dim mybodytag As HtmlGenericControl
  mybodytag = Page.Master.FindControl("mainbody")
  mybodytag.Attributes.Add("onload", "initialize()")
  End Sub
  </code></pre>