ThinkGeo.com    |     Documentation    |     Premium Support

GoogleOverlay with UpdatePanel Conditional, extend changes on asyncpostback

Hello, I have a map control inside UpdatePanel like this:

asp:UpdatePanel ID=“UpdatePanelMapa” runat=“server” UpdateMode=“Conditional” ChildrenAsTriggers=“false”
ContentTemplate
cc1:Map ID=“Map1” runat=“server” Height=“200px” Width=“400px” onclick=“Map1_Click” OnTrackShapeFinished=“Map1_TrackShapeFinished”
/cc1:Map
/ContentTemplate
/asp:UpdatePanel

Everything is working fine however, if I pan or change the zoom and after that I click on any other control (from other updatepanels) the extend of map changes to the previous view, I mean, the extend when I´ve updated the map panel, is there a solution for this?? If the map control is inside of conditional updatepanel the map extend must not be updated.

Thanks in advance.

Hi Julieta,

We guess you don’t check whether the request is post back when you create the map.

The web server will call Page_Load method every times when the client sends requests, so you must check the request isn’t post back when creating the map.

Here attachment is a WebForms demo, you can refer it.
8607.zip (175.4 KB)

If you have any questions, please feel free to contact us.

Thanks,
Don

Hello Don, the page is checking the postback in Page_Load like this:

If (!IsPostBack)
{
// Create map and overlays
}

I´ve checked with debug and conditions inside If (!IsPostBack) are executed the first time the page is loaded.
We are using UpdatePanel with UpdateMode=“Conditional” and when we pan or change the zoom the extend changes if we click on any other control (contained in other updatepanel) , have you seen this behavior before?

Thanks in advance.

Hi Julieta,

Have you tested my attached 8607.zip in previous reply?

I modified the aspx file like this:

  <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel runat="server">
            <ContentTemplate>
                <asp:Label ID="Label1" runat="server" Text="Time:"></asp:Label>
                <asp:Label ID="timeLabel" runat="server" Text="" Width="100"></asp:Label>
                <asp:Button ID="updateTimeButtom" runat="server" Text="Update Time" OnClick="UpdateTimeButtomClicked" />
            </ContentTemplate>
        </asp:UpdatePanel>

        <asp:UpdatePanel ID="UpdatePanel1" runat="server"  UpdateMode="Conditional" ChildrenAsTriggers="false">
            <ContentTemplate>
                <cc1:Map ID="Map1" runat="server" Height="600px" Width="800px">
                </cc1:Map>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</form>

And it still works well just like this:

So that means we still cannot reproduce your issue.

Could you please modify our sample to make it reproduce your issue? Our developer can look into it and help you solve that.

Regards,

Don

Hello Don, I´ve reproduced the error, please check the video (swf file ) and the code attached.
When we click on UpdatePanelMapa.Update() to refresh the map, after click on button in the other updatepanel the extend of map changes.
Thanks in advance.

Prueba.zip (3.0 MB)

Hi Julieta,

Thanks for your further information.

That looks the force update in server side is conflict with our postback in the special mode.

We will try to find a solution for you and update here.

Regards,

Don

Hi Julieta,

I think your target should be modify something for existing layer on the fly, but not only for change the extent.

So I created a sample shows how to implement that via callback process.

8607_webforms.zip (198.0 KB)

Wish that’s helpful.

Regards,

Don