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

Out of stack space

6 Answers 190 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Mitchell
Top achievements
Rank 1
Mitchell asked on 09 Nov 2012, 05:02 PM
If i have a radlistbox that is ajaxified and EnableDragAndDrop is true then when i click around somewhat fast I get [SCRIPT28: Out of stack space] error in ie developer. in Google chrome I get [Uncaught RangeError: Maximum call stack size exceeded]. Sometimes it says there is a long running script. There is nothing else on the page and the page_load event is the only code-behind. After it happens once it starts happening more frequently.

  • Telerik Q3 2012  - (2012.3.1016.35)
  • C# - asp.net 3.5
  • windows 7, 8GB RAM
  • ie9 & google chrome
  • IIS Worker Process Memory is at about 100K in task manager, CPU at 0%


<telerik:RadAjaxManager ID="RadAM1" runat="server">
     <AjaxSettings>
          <telerik:AjaxSetting AjaxControlID="btn">
             <UpdatedControls>
                 <telerik:AjaxUpdatedControl ControlID="radSelected"  />
             </UpdatedControls>
         </telerik:AjaxSetting>
     </AjaxSettings>
 </telerik:RadAjaxManager>
 
 <telerik:RadListBox ID="radSelected" runat="server" Width="100%" Height="400px" SelectionMode="Single" EnableDragAndDrop="true" AutoPostBack="true">
 </telerik:RadListBox>
 <asp:Button ID="btn" runat="server" Text="refresh" />

protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        List<string> strs = new List<string>();
        for (int i = 0; i < 500; i++)
            ints.Add("This is just some text to fill the listbox to show that it will get [SCRIPT28: Out of stack space] when you click around fast for about 20 seconds or less. The listbox freezes and then i get the script error when looking in ie development tool. " + i);
        radSelected.DataSource = ints;
        radSelected.DataBind();
    }
}




Any ideas?

6 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 14 Nov 2012, 09:29 AM
Hi Mitchell,

The error is caused by conflicting ajax requests. In other words, when a request is sent before the previous one was completed. There are a couple of approaches you can take to resolve this:
1. Set the RequestQueueSize property of RadAjaxManager to a high enough number (for instance 10). This causes every request to be stored in an internal queue (with the specified capacity) and be executed only when no other request is in progress.
2. You can use the approach from the following help article:
http://www.telerik.com/help/aspnet-ajax/ajax-disable-controls-during-ajax.html

 
Regards,
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.
0
Mitchell
Top achievements
Rank 1
answered on 14 Nov 2012, 03:42 PM
Thanks for responding.

Both ways sound good but do not work when EnableDragAndDrop="true".
If EnableDragAndDrop="false" everything is fine, but i really need the drag drop feature.  I guess something broke with the latest upgrade.

I have it in production working with version 2011.1.519.35 with no problems, but it does not work with 2012.3.1016.35.

It is preventing someone from just clicking through the list at a moderate speed for just a few clicks.



anymore ideas?



0
Bozhidar
Telerik team
answered on 16 Nov 2012, 09:57 AM
Hi MItchell,

Could you elaborate a bit on how the approach from the help article I provided conflicts with the DragAndDrop feature and why it's not a suitable solution for you.
 
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.
0
Mitchell
Top achievements
Rank 1
answered on 16 Nov 2012, 02:57 PM
I tried both ways and it makes no difference, and I still get the out of stack space/long running script errors after a few clicks.  

The RequestQueueSize property did not make any difference - no matter what I set the value to (10,100,1000).  

If I use the method to disable the controls during ajax it still must be doing something on the client because I get the error, and it freezes for several seconds even when the control is still disabled.

Only thing I have noticed (regardless of the two solutions you mentioned) is when I set the EnableDragAndDrop to false the problem does not occur.  When it is set to true drag and drop still works fine, but it freezes and I get the out of stack space error after a few clicks.


Thanks for your help.
0
Accepted
Bozhidar
Telerik team
answered on 21 Nov 2012, 08:32 AM
Hello Mitchell,

Could you run the attached page and try to reproduce the issue. Also, please record a video capture of the problem and send it back. For this purpose you can use a tool such as jing.
 
Regards,
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.
0
Mitchell
Top achievements
Rank 1
answered on 26 Nov 2012, 03:19 PM
Hey Bozhidar,

The code you sent is different from the help article link and your code works.  The article is using "args.EventTargetElement.disabled=true" and you are using "$find(args.EventTargetElement.id).set_enabled(false);".

I am using it like this to only disable the listbox and everything works as expected. Thanks...
function RequestStart(sender, args) {          
    if (args.EventTarget == "<%= radSelected.UniqueID %>") {
        $find(args.EventTargetElement.id).set_enabled(false);
    }
}
function ResponseEnd(sender, args) {
    if (args.EventTarget == "<%= radSelected.UniqueID %>") {
        $find(args.EventTargetElement.id).set_enabled(true);
    }
}


Thanks,
Mitchell

Tags
ListBox
Asked by
Mitchell
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Mitchell
Top achievements
Rank 1
Share this question
or