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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

130045 Apr 18,2017 07:10 AM Apr 19,2017 02:19 AM ASP.NET MVC 1
loading
Tags: General
Krasimir Georgiev
Asked On April 18, 2017 07:10 AM

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!

Prince Oliver [Syncfusion]
Replied On April 19, 2017 02:19 AM

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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;