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

RadScriptManager (.NET 4.5) incompatible with AspNet.ScriptManager.jQuery

2 Answers 109 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Igor
Top achievements
Rank 2
Igor asked on 02 Oct 2014, 01:43 PM
Hello, I recently upgraded my Telerik project from .NET 4.0 to 4.5.1.
I' m having a lot of issues with jQuery.
Basically the following piece of markup 

    <telerik:RadScriptManager ID="_scriptManager" runat="server">
        <Scripts>
            <asp:ScriptReference Name="jquery" />
        </Scripts>
    </telerik:RadScriptManager>

in .NET 4.0 renders the jquery include, but in .NET 4.5 renders nothing, no jquery.

The only workaround I fond is to use the embedded Telerik jQuery.

    <telerik:RadScriptManager ID="_scriptManager" runat="server">
    </telerik:RadScriptManager>
    <script type="text/javascript">
        window.jQuery = window.$ = $telerik.$;
    </script>

2 Answers, 1 is accepted

Sort by
0
Igor
Top achievements
Rank 2
answered on 02 Oct 2014, 01:45 PM
Sorry, this is the correct workaround

    <telerik:RadScriptManager ID="_scriptManager" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />  
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />  
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        window.jQuery = window.$ = $telerik.$;
    </script>
0
Accepted
Slav
Telerik team
answered on 06 Oct 2014, 04:24 PM
Hi Igor,

Indeed, the jquery mapping that is added with the AspNet.ScriptManager.jQuery package is cleared by the RadScriptManager on the page in .NET 4.5 projects.

We will post a help article with information about handling such scenarios. Until it is live you can also try installing the following package - https://www.nuget.org/packages/Microsoft.AspNet.ScriptManager.WebForms, then configuring RadScriptManager as shown below:
<telerik:RadScriptManager ID="_scriptManager" runat="server" EnableEmbeddedjQuery="false">
    <Scripts>
        <asp:ScriptReference Name="jquery" />
        <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
        <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
    </Scripts>
</telerik:RadScriptManager>

This should allow you to use the version of jQuery that comes with AspNet.ScriptManager.jQuery, however the same version will be used by the Telerik controls as well. If the version of the external jQuery is different than the one that is included in the Telerik controls you may run into problems with their functionality.

Regards,
Slav
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ScriptManager and StyleSheetManager
Asked by
Igor
Top achievements
Rank 2
Answers by
Igor
Top achievements
Rank 2
Slav
Telerik team
Share this question
or