Questions on ASP.NET AJAX Performance

Last post 05-28-2009 3:40 PM by mthakershi. 6 replies.

Sort Posts:

  • Questions on ASP.NET AJAX Performance

    05-28-2009, 10:38 AM
    • Member
      329 point Member
    • mthakershi
    • Member since 05-07-2007, 5:22 PM
    • Posts 208

    I came to know about this topic from another thread.

    Please look at the following link. It talks about how to optimize ScriptManager to reduce number of requests and faster download.

    http://lancezhang.wordpress.com/2008/11/15/aspnet-ajax-performance/

    I tried to implement this but I am not able to move past point 2.

    My issue:

    When I put ToolkitScriptManager in my master page instead of asp:scriptmanager, I start getting AjaxControlToolkit is not defined javascript errors.

    I use ScriptManagerProxy in my web content form. Is there any replacement for that too?

    Thank you.

  • Re: Questions on ASP.NET AJAX Performance

    05-28-2009, 10:56 AM
    • Contributor
      5,138 point Contributor
    • papabear
    • Member since 08-08-2005, 3:49 PM
    • Posts 851

    Just a quick check - what version of the toolkit are you using? Make sure it is the latest. Also, are you referencing the specific build number?

    thanks,

    m

    give me suggestions for what to blog... http://www.myfriedmind.com/techblog -> thx

    Mark as "Answered" if this solves that wee old problem...
  • Re: Questions on ASP.NET AJAX Performance

    05-28-2009, 11:02 AM
    • Member
      329 point Member
    • mthakershi
    • Member since 05-07-2007, 5:22 PM
    • Posts 208

    When I see version on my AjaxControlToolkit reference I see 3.0.11119.26730

    And Runtime version is v2.0.50727

  • Re: Questions on ASP.NET AJAX Performance

    05-28-2009, 1:18 PM
    • Contributor
      5,138 point Contributor
    • papabear
    • Member since 08-08-2005, 3:49 PM
    • Posts 851

    lol, that should be fine...

    How are you referencing that in your pages - are you doing it via web.config or on the pages themselves?

    thanks,

    give me suggestions for what to blog... http://www.myfriedmind.com/techblog -> thx

    Mark as "Answered" if this solves that wee old problem...
  • Re: Questions on ASP.NET AJAX Performance

    05-28-2009, 2:59 PM
    • Member
      329 point Member
    • mthakershi
    • Member since 05-07-2007, 5:22 PM
    • Posts 208

    Hello. I am having this line in each page that wishes to use ASP.NET AJAX. Is there any better alternative?

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

    Ok. I decided to get latest. So now AjaxControlToolkit version is 3.0.30512.17815

    So now asp:ScriptManager itself has <CompositeScript> section.

    I also downloaded ScriptReferenceProfiler control from

    http://weblogs.asp.net/bleroy/archive/2008/06/12/script-reference-profiler.aspx

    This gives me at the end of the page JS files being used.

    Now my issue again:

    I have MasterPage, Content pages and sometimes UserControls inside them.

    When I put my scripts inside CompositeScript section it throws error. Even if I include say AjaxControlToolkit.Common.Common.js along with my CompositeScript it shows up as a seperate reference in the script reference profiler.

    "The resource URL cannot be longer than 1024 characters. If using a CompositeScriptReference, reduce the number of ScriptReferences it contains, or combine them into a single static file and set the Path property to the location of it."

  • Re: Questions on ASP.NET AJAX Performance

    05-28-2009, 3:23 PM
    Answer
    • Contributor
      5,138 point Contributor
    • papabear
    • Member since 08-08-2005, 3:49 PM
    • Posts 851

     You can register the AjaxControlToolkit in the web.config

    <pages>
       <controls>
           <add tagPrefix="ajax" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit, Version=3.0.30512.17815"/>
       </controls>
    </pages>

    As per the error you are getting - you will need to use multiple Proxy Script Manager controls. Here is a good post on that -> http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=363

    Hope this helps

    give me suggestions for what to blog... http://www.myfriedmind.com/techblog -> thx

    Mark as "Answered" if this solves that wee old problem...
  • Re: Questions on ASP.NET AJAX Performance

    05-28-2009, 3:40 PM
    • Member
      329 point Member
    • mthakershi
    • Member since 05-07-2007, 5:22 PM
    • Posts 208

    I tried that link. However, I am not able to figure out what would be the correct order. If I just put them in different proxys it throws errors like

    Type is undefined.

    AjaxControlToolkit is undefined.

    I think even within Ajax toolkit scripts some need to be downloaded before others. Here is my sequence in content page:

    <asp:ScriptManagerProxy ID="ScriptManagerProxy4" runat="server">

    <CompositeScript ScriptMode="Release">

    <Scripts>

    <asp:ScriptReference name="AjaxControlToolkit.ExtenderBase.BaseScripts.js" assembly="AjaxControlToolkit, Version=3.0.30512.17815, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

    <asp:ScriptReference name="AjaxControlToolkit.Common.Common.js" assembly="AjaxControlToolkit, Version=3.0.30512.17815, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

    <asp:ScriptReference name="AjaxControlToolkit.Common.DateTime.js" assembly="AjaxControlToolkit, Version=3.0.30512.17815, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

    <asp:ScriptReference name="AjaxControlToolkit.Common.Threading.js" assembly="AjaxControlToolkit, Version=3.0.30512.17815, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

    </Scripts>

    </CompositeScript>

    </asp:ScriptManagerProxy>

    <asp:ScriptManagerProxy ID="ScriptManagerProxy2" runat="server">

    <CompositeScript ScriptMode="Release">

    <Scripts>

    <asp:ScriptReference name="MicrosoftAjaxTimer.js" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <asp:ScriptReference name="AjaxControlToolkit.Compat.Timer.Timer.js" assembly="AjaxControlToolkit, Version=3.0.30512.17815, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

    </Scripts>

    </CompositeScript>

    </asp:ScriptManagerProxy>

    <asp:ScriptManagerProxy ID="ScriptManagerProxy3" runat="server">

    <CompositeScript ScriptMode="Release">

    <Scripts>

    <asp:ScriptReference name="AjaxControlToolkit.Animation.Animations.js" assembly="AjaxControlToolkit, Version=3.0.30512.17815, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

    <asp:ScriptReference name="AjaxControlToolkit.Animation.AnimationBehavior.js" assembly="AjaxControlToolkit, Version=3.0.30512.17815, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

    <asp:ScriptReference name="AjaxControlToolkit.PopupExtender.PopupBehavior.js" assembly="AjaxControlToolkit, Version=3.0.30512.17815, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

    <asp:ScriptReference name="AjaxControlToolkit.AutoComplete.AutoCompleteBehavior.js" assembly="AjaxControlToolkit, Version=3.0.30512.17815, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

    <asp:ScriptReference name="AjaxControlToolkit.Calendar.CalendarBehavior.js" assembly="AjaxControlToolkit, Version=3.0.30512.17815, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

    <asp:ScriptReference name="AjaxControlToolkit.CollapsiblePanel.CollapsiblePanelBehavior.js" assembly="AjaxControlToolkit, Version=3.0.30512.17815, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

    </Scripts>

    </CompositeScript>

    </asp:ScriptManagerProxy>

    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">

    <CompositeScript ScriptMode="Release">

    <Scripts>

    <asp:ScriptReference name="MattBerseth.WebControls.AJAX.GridViewControl.GridViewControlBehavior.js" assembly="MattBerseth.WebControls.AJAX, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"/>

    <asp:ScriptReference Path="~/Resources/JS/DefaultPageScripts.js" />

    </Scripts>

    </CompositeScript>

    </asp:ScriptManagerProxy>

    -----------------------------------------------------------------------------------------------------------------

    MasterPage

    <asp:ScriptManagerProxy ID="scrProxy1" runat="server">

    <CompositeScript ScriptMode="Release">

    <Scripts>

    <asp:ScriptReference name="MicrosoftAjax.js"/>

    <asp:ScriptReference name="MicrosoftAjaxWebForms.js"/>

    </Scripts>

    </CompositeScript>

    </asp:ScriptManagerProxy>

    <asp:ScriptManagerProxy ID="scrProxy2" runat="server">

    <CompositeScript ScriptMode="Release">

    <Scripts>

    <asp:ScriptReference Path="~/Resources/JS/MasterPageScripts.js" />

    <asp:ScriptReference Path="~/Resources/JS/dw_tooltips/js/dw_tooltip.js" />

    </Scripts>

    </CompositeScript>

    </asp:ScriptManagerProxy>

Page 1 of 1 (7 items)