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

RadScriptManager - combining scripts + loadafterGui

1 Answer 298 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 19 Nov 2008, 04:04 PM
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:

 <telerik:RadScriptManager ID="RadScriptManager1" EnablePartialRendering="false" EnableScriptCombine="True" 
        EnableViewState="false" runat="server" OutputCompression="Disabled" ScriptMode="Release" LoadScriptsBeforeUI="false" 
        CompositeScript-ScriptMode="Release">  
        <CompositeScript> 
            <Scripts> 
                <asp:ScriptReference Name="MicrosoftAjax.js" NotifyScriptLoaded="true" /> 
                <asp:ScriptReference Name="MicrosoftAjaxWebForms.js" /> 
            </Scripts> 
        </CompositeScript> 
    </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

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 24 Nov 2008, 04:46 PM
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.
Tags
General Discussions
Asked by
Richard
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or