This demo purpose to avoid EJ1 & EJ2 compatibility issues.
The below setps help you to render EJ1 and EJ2 Syncfusion components in a single page ASP.NET MVC Application.
You can create Essential JS 1 and Essential JS 2 controls using below getting started links
Add compatibility styles. We have Essential JS 1 and Essential JS 2 compatibility style which won’t affect each other.
@* Syncfusion Essential JS 1 Styles *@
@Styles.Render("https://cdn.syncfusion.com/16.1.0.24/js/web/bootstrap-theme/ej.web.all.compatibility.min.css")
@* Syncfusion Essential JS 2 Styles *@
@Styles.Render("https://cdn.syncfusion.com/ej2/styles/compatibility/material.css")
Add scripts for Essential JS 1 and Essential JS 2 as below.
@* Syncfusion Essential JS 1 Scripts *@
@* Syncfusion Essential JS 2 Scripts *@
Note: Need to add ej1 script before ej2 scripts or else it will throw script error.
To achieve this requirement, you need to use the below code in _Layout.cshtml
page. Because EJ1 and EJ2 has same library names to perform the different actions. So conflicts may occur when we refer this both controls in same application. To overcome this we need to extend this libraries in ej namespace.
Define Script manager for both Essential JS 1 and Essential JS 2
@Html.EJ().ScriptManager()
@Html.EJS().ScriptManager()
Finally, The Layout page looks like:
@* Syncfusion Essential JS 1 Styles *@ @Styles.Render("http://cdn.syncfusion.com/16.3.0.21/js/web/flat-azure/ej.web.all.min.css") @* Syncfusion Essential JS 2 Styles *@ @Styles.Render("https://cdn.syncfusion.com/ej2/styles/compatibility/material.css") @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @Scripts.Render("~/Scripts/jsrender.min.js") @* Syncfusion Essential JS 1 Scripts *@ @Scripts.Render("~/Scripts/ej/web/ej.web.all.min.js") @* Syncfusion Essential JS 2 Scripts *@ @Scripts.Render("~/Scripts/ej2/ej2.min.js") @RenderSection("scripts", required: false) @Html.EJ().ScriptManager() @Html.EJS().ScriptManager()