RadScriptManager - combining scripts + loadafterGui

2 posts, 0 answers
  1. Richard
    Richard avatar
    38 posts
    Member since:
    Nov 2008

    Posted 19 Nov 2008 Link to this post

    Hi,

    when combining scripts i still get a number of script references on my page.

    In particular a webresource.axd with about 500 lines of code (containing "function WebForm_PostBackOptions(eventTarget, eventArgument, validation, validationGroup, actionUrl, trackFocus, clientSubmit) {", etc)

    My script manager block (which i place in a masterpage) is as follows:

    1  <telerik:RadScriptManager ID="RadScriptManager1" EnablePartialRendering="false" EnableScriptCombine="True" 
    2         EnableViewState="false" runat="server" OutputCompression="Disabled" ScriptMode="Release" LoadScriptsBeforeUI="false" 
    3         CompositeScript-ScriptMode="Release">  
    4         <CompositeScript> 
    5             <Scripts> 
    6                 <asp:ScriptReference Name="MicrosoftAjax.js" NotifyScriptLoaded="true" /> 
    7                 <asp:ScriptReference Name="MicrosoftAjaxWebForms.js" /> 
    8             </Scripts> 
    9         </CompositeScript> 
    10     </telerik:RadScriptManager> 

    this brings it down to two references (webresource.axd  and Telerik.Web.UI.WebResource.axd )

    When i didn't include the <compositeScript> and the two references to Microsofts .js files, i got a number of scriptResources.axd's on my page.  Ditto if i set EnablePartialRendering=true.

    the page itself, contains a menu and a drop down.


    Also - i have set loadscriptsbeforeGUI to false - expecting the larger Telerik.Web.UI.WebResource.axd to render at the bottom of the page.  However, it is actually rendering nearer the top - just after the body tag.

    My desired outcome is to have all the script in one referenced file, linked to the page at the bottom.  Is this possible?  Can you tell me what i may be doing wrong?

     

     

    thanks,

     

     

    Richard

  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 24 Nov 2008 Link to this post

    Hi Richard,

    The output of the script, containing the WebForm_PostBackOptions, is actually code generated by ASP.NET and we have no control over it.

    Since Q3 2008, RadScriptManager automatically includes MicrosoftAjax.js and MicrosoftAjaxWebForms.js to the combined result. However, you need to have the LoadScriptsBeforeUI set to true (the default value) get this.

    If MicrosoftAjax.js and MicrosoftAjaxWebForms.js are included with the other scripts when LoadScriptsBeforeUI is set to false, the page would throw errors, caused by the other framework js code, referring classes, defined in the above mentioned files.

    So, with all this in mind the anwer to your quetion: "My desired outcome is to have all the script in one referenced file, linked to the page at the bottom. Is this possible?" is no, this is not possible.


    Greetings,
    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top