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

[Solved] Conflict between Asp:ScriptManager and Telerik ScriptRegistrar()

1 Answer 212 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anil
Top achievements
Rank 1
Anil asked on 09 Nov 2009, 07:09 PM

We are using Telerik asp.net control rad:RadSplitter in the Master page. This needs asp:ScriptManager to run. And all the javascript files are referenced inside the scriptManager in the Master page such as follows:

 

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">

            <Scripts>

                <asp:ScriptReference Path="~/Scripts/jquery-1.3.2.min.js" />

                <asp:ScriptReference Path="~/Scripts/TestGeneral16.js" />

                <asp:ScriptReference Path="~/Scripts/jQueryCustom5.js" />

                <asp:ScriptReference Path="~/Scripts/jquery.easing.1.3.js" />

                <asp:ScriptReference Path="~/Scripts/HoverNested20.js" />

                <asp:ScriptReference Path="~/Scripts/Intake.js" />

               <asp:ScriptReference Path="~/Scripts/FrontDesk.js" />

               <asp:ScriptReference Path="~/Scripts/corner.js" />

            </Scripts>

</asp:ScriptManager>

 

We tried to replace this with ScriptRegistrar() such as follows :

<%

    Html.Telerik().ScriptRegistrar().Scripts(scripts =>

                scripts.

                    .Add("~/Scripts/TestGeneral16.js")

                    .Add("~/Scripts/jQueryCustom5.js")

                    .Add("~/Scripts/jquery.easing.1.3.js")

                    .Add("~/Scripts/HoverNested20.js")

                    .Add("~/Scripts/Intake.js")

                    .Add("~/Scripts/FrontDesk.js")

                    .Add("~/Scripts/corner.js")

                    .Combined(true)

                    .Compress(false)

                    .CacheDurationInDays(30)

                    ))

                  .Render();

%> 

 

This did not work. It could not recognise some the javascript functions inside some of the javascript files.

 

Secondly, we are using Telerik MVC tabstip inside the content page :

 

<% Html.Telerik().TabStrip()

 

 

 

 


            .Name("TabStrip")
            .Items(tabstrip =>
            {
                tabstrip.Add()
                    .Text("ASP.NET MVC")

                    .Content(() =>
                    {%>
                        <p>Content</p>

                    <%});

                tabstrip.Add()
                    .Text("Silverlight")
                   

                    .Content(() =>
                    {%>
                                               <p>Content2</p>

                    <%});
                           })
            .SelectedIndex(0)
            .Render();
    %>

 

<%

        Html.Telerik().StyleSheetRegistrar()

            .DefaultGroup(group => group.Add("telerik.common.css")

                                        .Add("telerik.vista.css"))

            .Render();

    %>

 

   <%

     =Html.Telerik().ScriptRegistrar()

%>

 

This throws an exception because the scriptregistrar is loading the jquery-1.3.2.min.js again, which is already there is the master page.

 

We have included in the web.config the following:

1.  <add verb="GET,HEAD" path="asset.axd" validate="false" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc"/>

2. 

<add name="AssetHandler" preCondition="integratedMode" verb="GET,HEAD" path="asset.axd" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc"/>

 

If there is some other way to declare the ScriptRegistrar inside the content page, so that it does not include the jquery-1.3.2.min.js, which is already emitted in our master page, our problem will probably be solved.

 

Overall, we are using two methods to register .js files;
• Asp:ScriptManager
• Html.Telerik().ScriptRegistrar()

  It seems they are conflicting with each other.

Second Question:
Is it possible to make rad:RadSplitter working using SriptRegistrar instead of using asp:ScriptManager?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 10 Nov 2009, 08:35 AM
Hello Anil,

RadSplitter still requires a ScriptManager control so you cannot replace it with ScriptRegistrar.

You can disable the jQuery reference by the ScriptRegistrar like this:

<%= Html.Telerik().ScriptRegistrar().jQuery(false) %>

Regards,
Atanas Korchev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Anil
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or