This project is read-only.

GoogleMap inside UpdatePanel gets updated on EVERY postback

Feb 20, 2008 at 7:55 PM
Hi Velio,

it looks like our GoogleMap control inside UpdatePanel1 gets updated when a postback in UpdatePanel2 is invoked (e.g. via a button). I guess you chose to do it like that because earlier there were problems with the update of the map when place inside an UpdatePanel. Unfortunately, this means a lot of redrawing/rerendering for the map and I guess even bandwidth comsumption. Dou you think this problem can be easily fixed?

My setup:
In an aspx I have this code:
<asp:UpdatePanel runat="server" ID="upGoogleMaps" UpdateMode="Conditional">
    <ContentTemplate>
        <div>
            <artem:GoogleMap ID="artemGoogleMap" runat="server" Width="351px" Height="351px" [more...] >
            </artem:GoogleMap>
        </div>
        <div id="div" runat="server"></div>
    </ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="upCampsites" UpdateMode="Conditional" >
    <ContentTemplate>
        <asp:LinkButton ID="lbUpdateCampsites" runat="server" Text="Anzeigen" OnClick="testMethod" Visible="true" />
    </ContentTemplate>
</asp:UpdatePanel>
In my code-behind I have this:
protected void testMethod(object sender, EventArgs e) { div.InnerText = "HALLO"; }
What I do, is I click my button, the map reloads, but the HALLO in the div doesn't show - and it shouldn't, because it's placed inside an UpdatePanel with UpdateMode="Conditional". Well, I just thought I'd share this with you.

Take care,
Oliver
Feb 20, 2008 at 10:04 PM
Hi,
Try moving div to the second update panel where link button is.
If you forse postback and update of the firts update panel, then GoogleMap control has nothing to do.
It is just inside it. It doesn't control it.

Regards