Extreme CPU/Memory when in iframe

2 posts, 1 answers
  1. Andreas
    Andreas avatar
    137 posts
    Member since:
    May 2008

    Posted 19 Feb 2013 Link to this post

    Hi,

    We have discovered a really nasty thing with the RadListBox. In my sample below, the CPU will hit 100% and memory will go up to about 2GB (happens in both IE10 and Firefox, Chrome seems unaffected) for about 10 seconds. Will often crash the browser since we hit the 2GB limit if other tabs are open...

    This only occurs when the listbox is located inside an iframe, in my example I did this using a RadWindow, but a normal IFrame would do the same...

    Here is the main page:
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="window.aspx.vb" Inherits="TestaTredjepartWeb.window" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="s" runat="server">
        </asp:ScriptManager>
        <div>
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                <Windows>
                    <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true" AutoSize="true" NavigateUrl="listbox.aspx">
                    </telerik:RadWindow>
                </Windows>
            </telerik:RadWindowManager>
        </div>
        </form>
    </body>
    </html>

    And here is the content page:
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="listbox.aspx.vb" Inherits="TestaTredjepartWeb.listbox" %>
     
    <!DOCTYPE html>
     
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="s" runat="server">
            </asp:ScriptManager>
            <div>
                <asp:UpdatePanel ID="up" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <telerik:RadListBox ID="rlb" runat="server" Width="330px" AllowReorder="true" AutoPostBackOnReorder="true" EnableDragAndDrop="true">
                            <Items>
                                <telerik:RadListBoxItem Text="aaa" />
                                <telerik:RadListBoxItem Text="bbb" />
                                <telerik:RadListBoxItem Text="ccc" />
                                <telerik:RadListBoxItem Text="ddd" />
                                <telerik:RadListBoxItem Text="eee" />
                                <telerik:RadListBoxItem Text="fff" />
                                <telerik:RadListBoxItem Text="ggg" />
                                <telerik:RadListBoxItem Text="hhh" />
                            </Items>
                        </telerik:RadListBox>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
        </form>
    </body>
    </html>

    The listbox need to have autopostbackonreorder and be located in an updatepanel.
    To get this behavior:
    1. Move one item up or down by drag and drop.
    2. Move the cursor outside the radwindow (the mousout of the window will trigger this behavior)

    When profiling the script, it is the following function that is the problem:
    RadListBox._onDocumentMouseOut
    

    Regards
    Caesar
  2. Answer
    Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 19 Feb 2013 Link to this post

    Hello Andreas,

    This issue is caused by a bug that was introduced in december of 2012. The issue is now fixed and will be included in the official Q1 2013 version of the control.

    In the meantime you can use the following workaround to resolve the issue. Just put the following javascript on the page with the ListBox:
    var oldHandler = Telerik.Web.UI.RadListBox.prototype._stopDragging;
    Telerik.Web.UI.RadListBox.prototype._stopDragging = function() {
        $telerik.$(document).unbind(($telerik.isTouchDevice ? "t_touchout." : "mouseout.") + this.get_id());
        oldHandler.apply(this, []);
    }
     

    Greetings,
    Bozhidar
    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. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top