onresolvescriptreference called 17 thousand times

2 posts, 0 answers
  1. Matthew
    Matthew avatar
    7 posts
    Member since:
    May 2008

    Posted 11 Sep 2012 Link to this post

    I have a page with a telerik:RadScriptManager.  According to a profiler I'm using, in a single page load Telerik.Web.UI.RadScriptManager.OnResolveScriptReference() is called 16,949 times and accounts for a half second of my page load times.  I added my own handler for ResolveScriptReference and it does seem to be called quite a lot.  The Scripts collection has 7 scripts.  In my own handler, I can see that it's resolving the same scripts over and over: Telerik.Web.UI.Common.Core.js, Telerik.Web.UI.Common.jQuery.js, etc.

    This project using Telerik.Web.UI.DLL 2011.1.519.40.  I know that's an older version, I'm not sure i can get authorized to upgrade it (due to a fear of breaking something else).  I'm hoping there is some problem in the way this control is being used that I can alter in order to fix the problem, but I don't even know where to start.

  2. Dimitar Terziev
    Dimitar Terziev avatar
    1268 posts

    Posted 17 Sep 2012 Link to this post

    Hi Matthew,

    In general the OnResolveScriptReference method is called by the OnPreRender event handler for each script reference in the Scripts collection of the ScriptManger, which make it quite unusuall to be executed 16,949 times as it's in your case. In order to resolve this issue, please try to provide a sample page which I could test with the latest version of our controls.

    Dimitar Terziev
    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.
Back to Top