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

RadWindow Opens and then immediately closes.

2 Answers 652 Views
Window
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 2
Phil asked on 28 Dec 2010, 01:20 AM
Hi:

I am trying to lauch a window like I have done many times before and the window immediately closes.

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        //<![CDATA[
        function orderMaintenanceOpenWindow() {
            var ordNbr = document.getElementById("<%= orderNumberTextBox.ClientID %>").value;
            if (ordNbr == "") {
            }
            else {
                var winurl = "OrdersMaintenance.aspx?ordernbr=" + ordNbr;
                // alert(winurl);
                var oWnd = radopen(winurl, "orderMaintenanceWindow");
            }
            return false;
        }
        ...
        //]]>
    </script>
</telerik:RadScriptBlock>
<telerik:RadWindowManager ID="ordersSelectionRadWindowManager" runat="server" EnableViewState="True">
    <Windows>
        <telerik:RadWindow ID="orderMaintenanceWindow" runat="server"
            Height="600" Width="800" Title="Order Maintenance"
            KeepInScreenBounds="True" VisibleTitlebar="true" Modal="true"
            Behaviors="Close, Maximize, Move, Resize" InitialBehaviors="Maximize" />
    </Windows>
</telerik:RadWindowManager>
I see the window fully populated and it just closes.
Any suggestions?
Phil

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 28 Dec 2010, 10:41 AM
Hello Phil,

I am not sure about how you are calling the function "orderMaintenanceOpenWindow" to open window. This behavior can happen if there is a postback taking place after window is opened. Therefore, you need to cancel the postback if any.

Take an example, if the window is opened on ASP Button-Click, then adding "return false;" will cancel the postback and thereby the window remains on page. 

MarkUp:
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="orderMaintenanceOpenWindow(); return false; " />

Thanks,
Shinu.
Bevis
Top achievements
Rank 1
commented on 26 Aug 2021, 04:17 AM

Just add [AutoPostBack = false]  work for me

0
Phil
Top achievements
Rank 2
answered on 29 Dec 2010, 12:34 AM
Hi Shinu:

That solved it.  I am using a Linkbutton and the OnClientClick event.  I just copied the code from a working page, but this time it had this problem.

Phil
Tags
Window
Asked by
Phil
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Phil
Top achievements
Rank 2
Share this question
or