ComponentOne ASP.NET MVC Controls
Using Visual Studio Template
ASP.NET Core MVC Controls > Getting Started > Configuring your MVC Application > Using Visual Studio Template

Complete the following steps to create a new MVC Application using Visual Studio template:

  1. Select File | New | Project.
  2. Under installed templates, select Visual C# | Web | ASP.NET Core Web Application (.NET Core or .NET Framework).


  3. Set a Name and Location for your application. Click OK.
  4. In the New ASP.NET Core Web Application dialog, select Web Application under ASP.NET Core Templates, and click OK.

Configuring the project

Few additional steps are required to configure the project created using the basic Visual Studio template.

  1. From the Solution Explorer, expand the folder Views and double click the _ViewImports.cshtml file to open it.
  2. Add the following:
    _ViewImports
    Copy Code
    @addTagHelper *, C1.AspNetCore.Mvc
    
  3. (Optional) To add specific controls in your application, you need to add the following markups in _ViewImports.cshtml.

    Control Markup
    Financial Chart
    @addTagHelper *, C1.AspNetCore.Mvc.Finance 
    
    FlexSheet
    @addTagHelper *, C1.AspNetCore.Mvc.FlexSheet
    
    OLAP
    @addTagHelper *, C1.AspNetCore.Mvc.Olap
    
    MultiRow
    @addTagHelper *, C1.AspNetCore.Mvc.MultiRow
    
    FlexViewer
    @addTagHelper *, C1.AspNetCore.Mvc.FlexViewer
    

  4. Add the ASP.NET MVC Edition references to the project. In the Solution Explorer, right click References and select Manage NuGet Packages. In NuGet Package Manager, select https://www.nuget.org/api/v2/ as the Package source. Search for C1.AspNetCore.Mvc package, and click Install. Refer to Configuring NuGet Package Sources for information on manually configuring GrapeCity NuGet source.


    Note: "C1.AspNetCore.Mvc" gets added under the "dependencies" within project.json file of your project once you restore the packages.

  5. To use specific controls in your application, add the following NuGet Packages based on the control.

    Control Assembly (Location - C:\Program Files (x86)\ComponentOne\ASP.NET MVC Edition\bin)
    Financial Chart
    C1.AspNetCore.Mvc.Finance
    
    FlexSheet
    C1.AspNetCore.Mvc.FlexSheet
    
    OLAP
    C1.AspNetCore.Mvc.Olap
    
    MultiRow
    C1.AspNetCore.Mvc.MultiRow
    
    FlexViewer
    C1.AspNetCore.Mvc.FlexViewer
    

  6. To add a license, right-click the solution name from the Solution Explorer or go to the Tools menu, and then select GrapeCity License Manager. Optionally, you can also generate runtime license key and add it to your application. For more information, see Licensing topic.
  7. After completing the steps above, register the resources for the controls to be used in the application. For more information, see Registering Resources.
See Also