How to use Aspose.Cells.GridWeb with .NET Core
Contents
[
Hide
]
This topic explains how to use Aspose.Cells.GridWeb with .NET Core applications using Visual Studio.NET 2019. This topic is useful for the beginner-level developers working with Aspose.Cells.GridWeb.
Use Aspose.Cells.GridWeb with .NET Core
This topic shows how to use Aspose.Cells.GridWeb by making a sample website in Visual Studio 2019. The process has been divided into steps.
Step 1: Creating a New Project
- Open Visual Studio 2019.
- From the File menu, select New, then Project. Create a new project dialog is opened.
- Select ASP.NET Core Web Application from Visual Studio installed project templates and click Next.
- Specify a location where the location and the name of the project and click Create.
- Select the Web Application (Model-View-Controller) template and make sure that ASP .NET Core 2.1 is selected.
- Click Create.
Step 2: Checking the initial view
Running the newly created project shows the default template in the browser as shown in the image below.
Step 3: Adding Aspose.Cells.GridWeb
- Add the following Nuget Packages to the project
- Add Aspose.Cells.GridWeb Package
- Add the following to the _ViewImports.cshtml file in the Views folder.
The file will look like this after the modifications
- Put the following code in the HomeController’s Index method.
Remember to update the SessionStorePath and the ImportExcelFile path.
- Add the following code in the Index.cshtml file in the View > Home directory.
The file will look like this after the change.
- Add Session support and GridScheduedService in the Startup.cs file
- Add the following code snippet in the ConfigureServices method.
- Add the following code snippet in the Configure method.
- Put the latest acw_client in directory: wwwroot/js
- Add AcwController in Controllers to deal with the acw route map that can provide all the default operations for general edit action.
Step 4: Test the App
Running the app will the output similar to the one shown in the image below.