Search results

Getting Started

21 Oct 2021 / 2 minutes to read


To get start with ASP.NET MVC application, need to ensure the following software to be installed on the machine.

  1. .Net Framework 4.5 and above.
  3. Visual Studio

Preparing ASP.NET MVC application

The following steps to create ASP.NET MVC Application.

Step 1: Create ASP.NET MVC Application with default template project in Visual Studio.

Default Template

Step 2: Once your project created. We need to add Syncfusion EJ2 package into your application by using NuGet Package Manager.

Open the NuGet package manager.

Solution Explorer

Install the Syncfusion.EJ2.MVC4 package to the application.

Nuget Demo

After installation complete, this will be included in the project. You can refer it from the Project Assembly Reference.

Note: We need to install NewtonSoft.JSON as a dependency, since Syncfusion.EJ2 dependent to NewtonSoft.JSON package.

Step 3: Add Syncfusion.EJ2 namespace reference in Web.Config.

Copied to clipboard
<add namespace="Syncfusion.EJ2"/>
Copied to clipboard
    <add assembly="Syncfusion.EJ2" Version=15.3400.0.27, Culture=neutral, PublicKeyToken=31BF3856AD364E35"  />

Step 4: Add client side resources through CDN or local package in the layout page _Layout.cshtml.

Copied to clipboard
@* Syncfusion Essential JS 2 Scripts *@
<script src=""></script>

Step 5: Add Script Manager and namespace in layout page _Layout.cshtml.

Copied to clipboard
@using Syncfusion.EJ2;

. . .
. . .
. . .
. . .

Step 6: Now, we can add Syncfusion Essential JS 2 for ASP.Net Core components in any page you want.

We are going to render LinearGauge component in Index.cshtml page.

Copied to clipboard
<h2> Essential JS 2 for ASP.NET MVC LinearGauge </h2>


Add Gauge Title

You can add a title using title attribute to the linear gauge to provide quick information to the user.

Copied to clipboard
<h2> Essential JS 2 for ASP.NET MVC LinearGauge </h2>

 @Html.EJS().LinearGauge("container").Title("Temperature Measure").Render();


You can set the range to the axis using minimum and maximum attributes for axis tag. Refer below code snippet to add the axis range to lineargauge.

Copied to clipboard
  @Html.EJS().LinearGauge("container").Axes(new List<Syncfusion.EJ2.LinearGauge.LinearGaugeAxis> {
   new Syncfusion.EJ2.LinearGauge.LinearGaugeAxis
   Minimum = 0, Maximum = 200