Using jQuery and Telerik Extension for MVC together

 

Just use the simple code when registering the Telerik script in typically the master page:

<%= Html.Telerik().ScriptRegistrar().jQuery(false).DefaultGroup(group => group.Combined(true).Compress(true)) %>





The jQuery.(false) effects not to include the jQuery script source tag which you can then add in the head tag as follows in the same master page:


<head runat="server">
    <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
    <link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
    <link href="<%= Url.Content("~/Content/smoothness/jquery-ui-1.8.4.custom.css") %>" rel="stylesheet" type="text/css" />
    
    <script src="<%= Url.Content("~/Scripts/jquery-1.4.2.min.js") %>" type="text/javascript"></script>
    <script src="<%= Url.Content("~/Scripts/jquery-ui-1.8.4.custom.min.js") %>" type="text/javascript"></script>
           
    <asp:ContentPlaceHolder ID="HeadContent" runat="server" />
<%= Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.windows7.css").Combined(true).Compress(true)) %>
</head>

Note jQuery is a prerequisite for telerik. Disable this only when you desire to include jQuery separately and probably other jQuery plugins and themes features


Now you are free to use jQuery latest version and ui extension and other plugins

Comments

Popular Posts