Windows reappears on postback

3 posts, 1 answers
  1. Diego
    Diego avatar
    7 posts
    Member since:
    May 2011

    Posted 12 Jun 2012 Link to this post

    Hi, im having an issue with the RadWindow. After being closed, on a postback the window reappears and cannot be closed again. I'm using Telerik ASP.NET 11.1.426.0 Q1 2011

    Here's some code i have:

    ASPX
    <telerik:RadWindow ID="RadWindowPreindexarCarpeta" runat="server" Modal="True" Behaviors="Close, Move"
        VisibleStatusbar="False" Width="425px" Height="400px" Title="Editar tipo predefinido"
        OnClientShow="Garino_Axentria_DMP_Funciones_Indexacion_PreindexarCarpeta.onShow"
        OnClientClose="Garino_Axentria_DMP_Funciones_Indexacion_PreindexarCarpeta.onClose" EnableViewState="false">
        <ContentTemplate>
            <AxDMP:PreindexarCarpetaTag ID="PreindexarCarpeta" runat="server" />
        </ContentTemplate>
    </telerik:RadWindow>

    This is the JS associated:
    Garino_Axentria_DMP_Funciones_Indexacion_PreindexarCarpeta = {
        show: function (carpetaId) {
            var activeTooltip = Telerik.Web.UI.RadToolTip.getCurrent();
            if (activeTooltip)
                activeTooltip.hide();
            $find(Garino_Axentria_DMP_VerPreindexarCarpetaWindow).show();
            $find(Garino_Axentria_DMP_Funciones_Indexacion_PreindexarCarpetaAjaxPanel).ajaxRequest('carpetaId:' + carpetaId);
        },
     
        close: function () {
            $find(Garino_Axentria_DMP_VerPreindexarCarpetaWindow).close();
        },
     
        refresh: function () {
            var explorer = $find(Garino_Axentria_DMP_BusquedaPorCarpeta_RadFileExplorerPorCarpeta);
            if (explorer) { explorer.refresh(); }
            else { $find(Garino_Axentria_DMP_AjaxManagerId).ajaxRequest(); }
        },
     
        onShow: function () {
        },
     
        onClose: function () {
            Page_IsValid = true;
            Page_Validators = [];
        }
    }

    Thanks,
    Diego.
  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    5706 posts

    Posted 14 Jun 2012 Link to this post

    Hi Diego,

     This code seems fine, so the problem is most likely due to the way AJAX is used and with other scripts that may be injected from the server. Usually such behavior is due to methods like center(), autosize() and moveTo() that are called for the RadWindow when it is already closed as they need to redraw the popup. Could you check your code for such cases and see if removing them helps? For example an OnClientClose handler that does something more that what is shown in these snippets. Also, how are you using AJAX in this case? Is it done according to the guidelines from this article? If you are including the RadWindow in the AJAX postback does excluding it help? The better way to modify it is via JavaScript and its client-side API anyway, instead of on the server. Also, does upgrading to the latest version (Q2 2012 at the moment) help?


    All the best,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Diego
    Diego avatar
    7 posts
    Member since:
    May 2011

    Posted 15 Jun 2012 Link to this post

    We are adjusting to radwindow's content and centering it, the issue was with the .center() function, it was rendering the radwindow once closed...

    Thanks, Marin!
Back to Top