ThinkGeo.com    |     Documentation    |     Premium Support

Map Control In Master Page - New

I'm using MapSuite Web Edition 3.0 beta in a WebForm that has a master page. I can get the initial map to display but the Pan Zoom Bar and any AJAX capabilities seem to be unavailable/disabled. When I put the same control and code in a standard WebForm page with no master page everything works as it should.


I've proven this by creating a sample web app with two forms and one master page. The web form without the master page works properly, the one with the master page does not.


Is there a problem using the Map control in a WebForm with a master page?


Thanks for your rapid reply!


The map controls on each page are in an update panel. However, I've tried it outside an update panel on the master page example with the same result.


I attempted to attached a zipped archive to this post but I get an error indicating the file exceeds the max size of 250Kb despite the fact that the file is only 6Kb in size. If you can tell me how to get around this limitation I will happily transmit the file.


The project contains two web forms, Default.aspx and Default2.aspx and a master page MasterPage.master. Default.aspx has the map control within an update panel like so:


The master page has the following contents:


    <form>> id="form1" runat="server">      <asp:contentplaceholder id=""ContentPlaceHolder1"" runat=""server"">

        </asp:contentplaceholder>

    </form>


 


And Default.aspx has the following content<asp:content id=""Content2"" runat=""Server"" contentplaceholderid=""ContentPlaceHolder1""><asp:updatepanel id=""upnlMap"" runat=""server"" updatemode=""Conditional"">

<contenttemplate></contenttemplate>

</asp:updatepanel></asp:content>


Both Default.aspx and Default2.aspx have the following Page_Load code:


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not IsPostBack() Then

            Map1.MapUnit = GeographyUnit.DecimalDegree

            MapHelpers.AddLayersForSimpleRenderUSA(Map1)

            Map1.PanZoomBar.Enabled = True

            Map1.LayerSwitcher.Enabled = True

            Map1.MousePosition.Enabled = True

            Map1.BackgroundMap.GoogleMap.GoogleMapType = GoogleMapType.Normal

            Map1.BackgroundMap.GoogleMap.Name = "Google Map Layer"

            Map1.CurrentExtent = New RectangleShape(-94.64456, 39.13578, -94.4674, 39.03605)

        End If

    End Sub

 


The "MapHelpers.AddLayersForSimpleRenderUSA" method is verbatim what is in your samples.


Thanks for looking into this.


Bob Mc.



Bob, 
  
 I’m not sure why the discussion forums software is having a problem with your post but I did what I could to reconstruct your messages.  I have also deleted the old thread as it was as you said unusable.  We will have some results soon and let you know on the master pages issue. 
  
 David

Bob, 
  
   We have tested with master pages and we found the bug.  We mixed our Id’s and master pages caught us!  We have fixed this issue and will add a sample to ensure this doesn’t happen again.  We will be releasing a new beta next Monday and this will be fixed.  I will put a little reminder to update the ticket when the new version is out. 
  
 David

Thanks very much David. I've gotten around it temporarily by making the one page a standard Web Form, but that's not a long term solution for my app.


I'll be awaiting the next beta release. Thanks again.


Bob Mc.



The new Beta refresh has been posted so you can download it and try it out now. 
  
 Thanks!

Bob, 
  
 I wanted to follow-up and see if the new beta resolved the master pages problem.  We tested it here but I would like to know of that did the trick for you. 
  
 David