We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Defferable loading initialize script

Hello,
I am quite new to the Syncfusion UI framework. How can I load all initialize scripts on bottom of page?
Is it possible?

Regards,
CD

1 Reply

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team February 22, 2016 12:13 PM UTC

Hi Coung,

You can refer the ej scripts and other scripts just before the ending of the body tag in the _Layout.cshtml page. The ASP.Net MVC Controls will render in two mode Unobtrusive mode and Non-unobtrusive mode. The mode of rendering can be controlled by setting the UnobtrusiveJavascriptEnabled key of the appSettings in web.config. Refer to the following code examples.

Non-unobtrusive mode:

Web.config


  <appSettings>

            . . . .

    <add key="UnobtrusiveJavaScriptEnabled" value="false" />

  </appSettings>


_Layout.cshtml

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>@ViewBag.Title - My ASP.NET Application</title>

    <link rel='nofollow' href="~/Content/ej/web/flat-saffron/ej.widgets.all.min.css" rel="stylesheet" />

</head>

<body>

    @RenderBody()


    <script src="@Url.Content("~/Scripts/jquery-2.1.4.min.js")"></script>

    <script src="@Url.Content("~/Scripts/jsrender.min.js")"></script>

    <script src="@Url.Content("~/Scripts/jquery.easing-1.3.min.js")"></script>

    <script src="@Url.Content("~/Scripts/jquery.globalize.min.js")"></script>

    <script src="@Url.Content("~/Scripts/ej/ej.web.all.js")"></script>


    @Html.EJ().ScriptManager()

</body>
</html>


Unobtrusive mode:

To initialize the ej scripts in the unobtrusive mode for the deferred loading, use the InitUnobtrusiveInScriptManager key of the appSettings in web.config.

Web.config

 

<appSettings>

         . . . . .

    <add key="UnobtrusiveJavaScriptEnabled" value="true" />

    <add key="InitUnobtrusiveInScriptManager" value="true" />

  </appSettings>


_Layout.cshtml

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>@ViewBag.Title - My ASP.NET Application</title>

    <link rel='nofollow' href="~/Content/ej/web/flat-saffron/ej.widgets.all.min.css" rel="stylesheet" />

</head>

<body>

   

    @RenderBody()


    <script src="@Url.Content("~/Scripts/jquery-2.1.4.min.js")"></script>

    <script src="@Url.Content("~/Scripts/jsrender.min.js")"></script>

    <script src="@Url.Content("~/Scripts/jquery.easing-1.3.min.js")"></script>

    <script src="@Url.Content("~/Scripts/jquery.globalize.min.js")"></script>

    <script src="@Url.Content("~/Scripts/ej/ej.web.all.js")"></script>

    <script src="@Url.Content("~/Scripts/ej/ej.unobtrusive.min.js")"></script>

  @Html.EJ().ScriptManager();

</body>

</html>



Refer to the following Help Documents.

http://help.syncfusion.com/js/dependencies
http://help.syncfusion.com/js/unobtrusive-support
http://help.syncfusion.com/js/api/ejgrid
http://help.syncfusion.com/aspnetmvc/grid/getting-started

Regards,
Seeni Sakthi Kumar S.

Loader.
Live Chat Icon For mobile
Up arrow icon