Ext.net controls disappear inside updatepanel after postback

  1. #1

    Ext.net controls disappear inside updatepanel after postback

    Forum:
    I got a terrible bug I guess so. I'm using a ext.net controls and Map component called ASPMAP (http://www.vdsgeo.com/aspmap.aspx). We want to use ext.net controls becasuse have a pretty nice presentation. We already got a version, but is not with ext.net, are .net controls native.

    Please for run this example, firts you need to download it the trial version at ASPMAP.


    Html:
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager runat="server" ID="resourceExtManager" DisableViewState="false">
            </ext:ResourceManager>
            <asp:ScriptManager runat="server" EnablePageMethods="true">
            </asp:ScriptManager>
            <ext:Viewport runat="server" Layout="BorderLayout">
                <Items>
                    <ext:Panel runat="server" Region="Center">
                        <Items>
                            <ext:Panel
                                runat="server" Height="150"
                                Title="Mapa" Border="false">
                                <Content>
                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                        <ContentTemplate>
                                            <ext:Button ID="full" runat="server" Icon="MagnifierZoomIn" AutoPostBack="true" Width="30" OnClick="full_Click"></ext:Button>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </Content>
                            </ext:Panel>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
            <br />
            <br />
            <br />
            <br />
            <br />
            <div id="dvMaps">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <aspmap:Map ID="Map" runat="server" MapTool="Pan" ImageFormat="Png" ImageTempDirectory="/Temps" />
                        <aspmap:ZoomBar ID="ZoomBar2" runat="server" Position="TopLeft" Map="Map" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
        </form>
    </body>
    </html>
    VB:
    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
            AddLayer()
        End Sub
        Private Sub AddLayer()
            Map.AddLayer(MapPath("Mapa/Peru2.shp"))
        End Sub
        Protected Sub full_Click(sender As Object, e As EventArgs)
            Map.ZoomFull()
            UpdatePanel2.Update()
        End Sub
  2. #2
    Hello @jcardenas!

    Mixing up Ext.NET controls and dynamic <Content> takes the page consistency beyond Ext.NET "safe zone".

    These blocks exists but when using it you should take extra care as Ext.NET controls no longer govern they layouts therein and all sort of things can happen. Whenever they could, they should be avoided, as you can see by the example you provided.

    That said, unfortunately we can't really consider this a bug on Ext.NET or its underlying Ext JS framework, just because its output and consistency is overruled by the dynamic asp code you inject in the page.

    I believe in your case you can give the ext:Panel surrounding the UpdatePanel the behavior you need (to refresh the map within it), then you should not have issues with the disappearing button.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    I having the same issues:

    https://forums.ext.net/showthread.ph...-server-update

    Please

    Even with this changed are disappear.

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <ext:ResourceManager runat="server" ID="resourceExtManager" DisableViewState="false">
        </ext:ResourceManager>
        <form id="form1" runat="server">
            <asp:ScriptManager runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
                <ContentTemplate>
                    <ext:Button ID="full" runat="server" Icon="MagnifierZoomIn" AutoPostBack="true" validateRequest="true" Width="30" OnClick="full_Click"></ext:Button>
                </ContentTemplate>
            </asp:UpdatePanel>
            <br />
            <br />
            <br />
            <br />
            <br />
            <div id="dvMaps">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" >
                    <ContentTemplate>
                        <aspmap:Map ID="Map" runat="server" MapTool="Pan" ImageFormat="Png" ImageTempDirectory="/Temps" />
                        <aspmap:ZoomBar ID="ZoomBar2" runat="server" Position="TopLeft" Map="Map" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
        </form>
    </body>
    </html>
  4. #4
    Hello again, @jcardenas!

    Unfortunately, support for the UpdatePanel was troublesome and unhealthy, please refer to this post from Geoffrey McGill regarding this subject: https://forums.ext.net/showthread.ph...l=1#post125201

    Some attempts were indeed taken to support this mixup and they did not prove fruitful so since at least since Ext.NET 2.4, we decided it was time to move on and drop support for that problematic combination. We currently are on Ext.NET 4.6 and I'm afraid this hasn't changed.

    I hope you understand.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 3
    Last Post: Feb 12, 2013, 9:01 AM
  2. Replies: 2
    Last Post: Mar 28, 2012, 9:13 AM
  3. Replies: 0
    Last Post: Mar 19, 2012, 3:56 PM
  4. [CLOSED] Drag does not function after postback to UpdatePanel
    By IT1333 in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Oct 28, 2011, 4:04 PM
  5. Replies: 3
    Last Post: Jul 22, 2009, 5:53 AM

Posting Permissions