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

Force telerik Webrsource.axd load before other scriptresources

1 Answer 186 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Amir
Top achievements
Rank 1
Amir asked on 06 Jan 2021, 06:09 AM

Hi

I'm using RadScriptManager to bundle external scripts like jquery.

There are other components in my project that use assembly resources to add scripts like jQuery.Ui.

the problem is that ScriptResource.axd is added to the page before Telerik.WebResource.axd so jquery is not added and it does not work.

is there any way to change this ordering and force telerik webresource for radscriptmanager to be added first.

best regards.

 

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 08 Jan 2021, 03:05 PM

Hi Amir,

Firstly, I wish you a Happy New Year 2021!

Telerik Components already have jQuery built-in, and in case you are trying to include external jQuery, there is a procedure. You can check out the Including external jQuery section of the Docs for instructions.

If you have that set, after that, you can register the script in any order you would like:

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableEmbeddedjQuery="false">
    <Scripts>
        <%--Add external jQuery--%>
        <asp:ScriptReference Path="https://example.domainame.com/scripts/jquery-3.0.js" />

        <%--Telerik References for External jQuery--%>
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryExternal.js" />
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryPlugins.js" />

        <%--Register Additional scripts here--%>
        <asp:ScriptReference Path="https://otherscripturl.here" />
        <asp:ScriptReference Assembly="AssemblyNameSpaceHere" />
    </Scripts>
</telerik:RadScriptManager>

Please give it a try and let me know how it goes.

Regards,
Attila Antal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ScriptManager and StyleSheetManager
Asked by
Amir
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or