This article provides a step-by-step introduction to configure Essential JS 2 setup, build and publish a simple ASP.NET MVC web application using Visual Studio.
Starting with v16.2.0.x, if you reference to Syncfusion assemblies from trial setup or NuGet feed, you should include a license key in your projects. Refer to this link to learn about registering Syncfusion license key in your ASP.NET MVC application to use the components.
To get started with ASP.NET MVC 5 application, ensure the following software to be installed on the machine.
The Essential JS 2 supports 4.5+ .NET Framework in the ASP.NET MVC application. i.e. The minimum target framework is 4.5 for Syncfusion ASP.NET MVC (Essential JS 2).
Syncfusion.EJ2.MVC5
NuGet package to the new application by using the Nuget Package Manager. Right-click the project and select Manage NuGet Packages….Refer to this article to learn more details about installing Essential JS 2 NuGet packages in various OS environment.
Syncfusion EJ2 MVC5
keyword in the Browse tab and install Syncfusion.EJ2.MVC5 NuGet package in the application.
The Essential JS 2 MVC5 NuGet package will be included in the project, after the installation process is completed.
Note: The Syncfusion.EJ2.MVC5 NuGet package has dependencies,
Newtonsoft.Json
for JSON serialization andSyncfusion.Licensing
for validating Syncfusion license key.
~/Views/Web.config
file and add the Syncfusion.EJ2
namesapce reference to the <system.web.webPages.razor>
element and Syncfusion.EJ2
assembly reference to <system.web>
element.<configuration>
....
....
<system.web.webPages.razor>
....
....
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
....
....
<add namespace="Syncfusion.EJ2"/>
</namespaces>
</pages>
</system.web.webPages.razor>
....
....
<system.web>
<compilation>
<assemblies>
....
....
<add assembly="Syncfusion.EJ2, Culture=neutral" />
</assemblies>
</compilation>
</system.web>
</configuration>
<head>
element of ~/Views/Shared/_Layout.cshtml
layout page.<head>
....
....
<!-- Syncfusion Essential JS 2 Styles -->
<link rel="stylesheet" href="https://cdn.syncfusion.com/ej2/material.css" />
<!-- Syncfusion Essential JS 2 Scripts -->
<script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js"></script>
</head>
<body>
element in the ~/Views/Shared/_Layout.cshtml
layout page.<body>
....
....
<!-- Syncfusion Essential JS 2 ScriptManager -->
@Html.EJS().ScriptManager()
</body>
cshtml
) in the ~/Views
folder.For example, the calendar component is added to the ~/Views/Home/Index.cshtml
page.
<div>
@Html.EJS().Calendar("calendar").Render()
</div>
To get started with ASP.NET MVC 5 application, ensure the following software to be installed on the machine.
The Essential JS 2 supports 4.5+ .NET Framework in the ASP.NET MVC application. i.e. The minimum target framework is 4.5 for Syncfusion ASP.NET MVC (Essential JS 2).
Syncfusion.EJ2.MVC5
NuGet package to the new application by using the Nuget Package Manager. Right-click the project and select Manage NuGet Packages….Refer to this article to learn more details about installing Essential JS 2 NuGet packages in various OS environment.
Syncfusion EJ2 MVC5
keyword in the Browse tab and install Syncfusion.EJ2.MVC5 NuGet package in the application.
The Essential JS 2 MVC5 NuGet package will be included in the project, after the installation process is completed.
Note: The Syncfusion.EJ2.MVC5 NuGet package has dependencies,
Newtonsoft.Json
for JSON serialization andSyncfusion.Licensing
for validating Syncfusion license key.
~/Views/Web.config
file and add the Syncfusion.EJ2
namesapce reference to the <system.web.webPages.razor>
element and Syncfusion.EJ2
assembly reference to <system.web>
element.<configuration>
....
....
<system.web.webPages.razor>
....
....
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
....
....
<add namespace="Syncfusion.EJ2"/>
</namespaces>
</pages>
</system.web.webPages.razor>
....
....
<system.web>
<compilation>
<assemblies>
....
....
<add assembly="Syncfusion.EJ2, Culture=neutral" />
</assemblies>
</compilation>
</system.web>
</configuration>
<head>
element of ~/Views/Shared/_Layout.cshtml
layout page.<head>
....
....
<!-- Syncfusion Essential JS 2 Styles -->
<link rel="stylesheet" href="https://cdn.syncfusion.com/ej2/material.css" />
<!-- Syncfusion Essential JS 2 Scripts -->
<script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js"></script>
</head>
<body>
element in the ~/Views/Shared/_Layout.cshtml
layout page.<body>
....
....
<!-- Syncfusion Essential JS 2 ScriptManager -->
@Html.EJS().ScriptManager()
</body>
cshtml
) in the ~/Views
folder.For example, the calendar component is added to the ~/Views/Home/Index.cshtml
page.
<div>
@Html.EJS().Calendar("calendar").Render()
</div>
To get started with ASP.NET MVC 4 application, ensure the following software to be installed on the machine.
The Essential JS 2 supports 4.5+ .NET Framework in the ASP.NET MVC application. i.e. The minimum target framework is 4.5 for Syncfusion ASP.NET MVC (Essential JS 2).
Syncfusion.EJ2.MVC4
NuGet package into the new application by using the Nuget Package Manager. Right-click the project and select Manage NuGet Packages….Refer to this article to learn more details about installing Essential JS 2 NuGet packages in various OS environment.
Syncfusion EJ2 MVC4
in the search text box, and then install Syncfusion.EJ2.MVC4 NuGet package in the application.
The Essential JS 2 MVC4 NuGet package will be included in the project, after the installation process is completed.
Note: The Syncfusion.EJ2.MVC4 NuGet package has dependencies,
Newtonsoft.Json
for JSON serialization andSyncfusion.Licensing
for validating Syncfusion license key.
~/Views/Web.config
file and add the Syncfusion.EJ2
namesapce reference to the <system.web.webPages.razor>
element, and then add Syncfusion.EJ2
assembly reference to the <system.web>
element.<configuration>
....
....
<system.web.webPages.razor>
....
....
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
....
....
<add namespace="Syncfusion.EJ2"/>
</namespaces>
</pages>
</system.web.webPages.razor>
....
....
<system.web>
....
....
<pages>
<controls>
....
....
<add assembly="Syncfusion.EJ2, Culture=neutral" tagPrefix="mvc"/>
</controls>
</pages>
</system.web>
</configuration>
<head>
element of ~/Views/Shared/_Layout.cshtml
layout page.<head>
....
....
<!-- Syncfusion Essential JS 2 Styles -->
<link rel="stylesheet" href="https://cdn.syncfusion.com/ej2/material.css" />
<!-- Syncfusion Essential JS 2 Scripts -->
<script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js"></script>
</head>
<body>
element in the ~/Views/Shared/_Layout.cshtml
layout page.<body>
....
....
<!-- Syncfusion Essential JS 2 ScriptManager -->
@Html.EJS().ScriptManager()
</body>
cshtml
) in the ~/Views
folder.For example, the calendar component is added to the ~/Views/Home/Index.cshtml
page.
<div>
@Html.EJS().Calendar("calendar").Render()
</div>