This is a migrated thread and some comments may be shown as answers.

Windows reappears on postback

2 Answers 43 Views
Window
This is a migrated thread and some comments may be shown as answers.
Diego
Top achievements
Rank 1
Diego asked on 12 Jun 2012, 07:19 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 14 Jun 2012, 02:39 PM
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.
0
Diego
Top achievements
Rank 1
answered on 15 Jun 2012, 09:32 PM
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!
Tags
Window
Asked by
Diego
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Diego
Top achievements
Rank 1
Share this question
or