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

Problem with Syncfusion ASP.NET MVC 5.0 NuGet Package v15.1.0.41 when set UnobtrusiveJavaScriptEnabled to true

Hi, I use NuGet packages Suyncfusion.AspNet.Mvc5 v15.1.0.41. Everything is OK when UnobtrusiveJavaScriptEnabled is false in Web.config. But when I set UnobtrusiveJavaScriptEnabled to true I receive this error: "Uncaught ReferenceError: ej is not defined". I addе а reference to ej.unobtrusive.min.js file next to ej.unobtrusive.min.js in _Layout.cshtml.

Please help!

1 Reply

PO Prince Oliver Syncfusion Team April 19, 2017 06:19 AM UTC

Hi Krasimir,   
  
Thank you for contacting Syncfusion support.   
  
When unobtrusive Javascript is enabled serialized script to render the control it will be rendered along with the control’s valid tag and it will not be rendered in a separate script section. Hence during page load, this causes the script to render before the ej.web.all.min.js file and other dependent script file loads. In order to overcome the issue, we suggest you to move the script section before the renderbody or place it in the head section.   
  
[_Layout.cshtml]   
 
    @Scripts.Render("~/bundles/jquery") 
    @Scripts.Render("~/bundles/bootstrap") 
    <script src="~/Scripts/ej/web/ej.web.all.min.js"></script> 
    <script src="~/Scripts/ej/common/ej.unobtrusive.min.js"></script> 
    @RenderSection("scripts", required: false) 
 
    <div class="container body-content"> 
        @RenderBody() 
        <hr /> 
        <footer> 
            <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p> 
        </footer> 
    </div> 



Refer to following UG link for Getting started through Nuget Packages: https://help.syncfusion.com/aspnetmvc/getting-started#through-nuget-packages 

Regards, 
Prince 


Loader.
Up arrow icon