Control Kendo Script Position Rendering in MVC

kendo-asp.net-mvc, kendo-ui

Solution

In the 2013 Q1 release, they added support for deferred scripts. You can use it like so:

@(Html.Kendo().AutoCompleteFor(m => m)
    .Filter(FilterType.Contains)
    .MinLength(2)
    .DataSource(config =>
        {
            config.Read(action, controller, routeValues);
            config.ServerFiltering(true);
        }).Deferred())

Note the `Deferred()` method in the end of the chain. Then, in your layout add the following anywhere in your markup:

  <!-- ... -->
  @Html.Kendo().DeferredScripts()
  </body>
</html>

See http://www.kendoui.com/forums/mvc/general-discussions/kendo-initialization-scripts-in-body-interfere-with-other-libraries.aspx for more information.

Problem

I'm using the Kendo ASP.NET MVC wrappers. I noticed the wrappers are rendering the scripts to initialize the controls immediately after the control markup. Is there a way to configure to have the scripts render at the bottom? Before, with the Telerik ASP.NET MVC controls, you could have the script manager render all the initializations at the bottom. Is that possible?

Original source