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

Add event to the radwindow on the client cause a javascript error: "Out of stack space"

1 Answer 63 Views
Window
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 30 May 2011, 08:46 AM
There are two pages, default.aspx and default2.aspx
default.aspx open radwindow on the client.
default2.aspx add event like add_commnd or add_resize will cause an error "Out of stack space"

Please help me fix this issue. thank you.

Below are the code for those two pages
default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Main.Test.Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnableTheming="True">
        <Scripts>          
         <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />  
         <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />  
         <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />   
        </Scripts>
    </asp:ScriptManager>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>
    </form>
    <script>
        $(document).ready(function ()
        {
            var oWindow = window.radopen("Default2.aspx"null);
        });        
    </script>
</body>
</html>

default2.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default2.aspx.cs" Inherits="Main.Test.Default2" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" EnableTheming="True">
        <Scripts>          
         <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />  
         <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />  
         <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />              
        </Scripts>
    </asp:ScriptManager>
    <div>
    default2
    </div>
    </form>
    <script>
        $(document).ready(function ()
        {
            var oWindow = GetRadWindow();
 
            oWindow.add_resize(OnClientResize);
        });
 
        function OnClientResize(sender, eventArgs)
        {
            alert(sender.toString());
        }
 
        function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.radWindow;
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;
            return oWindow;
        }
    </script>
</body>
</html>

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 30 May 2011, 05:00 PM
Hi Eric,

 The stack overflow error that arises from this is due to a problem in the MS AJAX framework and we cannot fix it on our side.

The good news however is that we managed to find a workaround. The idea is to ensure that the function added to some object with add_close is in the context of the page where the object is.

I hope this helps. Same holds true for the add/remove_pageLoad()/resize() functions. That is why we would recommend to consider moving these functions in the parent page (where the RadWindow objects are) and to call them from within the content page when needed.

Best wishes,
Svetlina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Window
Asked by
Eric
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or