DEV Community

Cover image for Create Project ASP.NET Core 2.1
Hòa Nguyễn Coder
Hòa Nguyễn Coder

Posted on

Create Project ASP.NET Core 2.1

First, we open program Visual Studio 2019, choose ASP.NET CORE 2.1, In the article, I shared way create project ASP.NET CORE 2.1
Steps 1: Open program Visual Studio 2019
Steps 2: Choose ASP.NET CORE Version 2.1->select Web Application (Model-Controller-View) -> Create Project
Create Project ASP.NET Core 2.1  - hoanguyenit.com

  • wwwroot : it contains directories (css, images, js, lib), you can call file javascript, the following code below
<script src="~/js/jquery.min.js"></script>
Enter fullscreen mode Exit fullscreen mode
  • ViewImports.cshtml: you see it import library
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
Enter fullscreen mode Exit fullscreen mode

Example: you have ProductController.cs, TagHelpers help call (Controller,Action,Route)

<a asp-controller="Product" asp-action="Details" asp-route-id="2">View Detail</a>
Enter fullscreen mode Exit fullscreen mode
  • appsettings.json: use Configuration ConnectString SQL SERVER
{
  "Logging": {
    "LogLevel": {
      "Default": "Warning"
    }
  },
  "AllowedHosts": "*",
  "ConnectionStrings": {
    "EFDataContext": "Server=DESKTOP-GCABV8F\\SQLExpress;Database=ProdctDB;Trusted_Connection=True;MultipleActiveResultSets=true"
  }
}
Enter fullscreen mode Exit fullscreen mode

The Article : Create Project ASP.NET Core 2.1

Top comments (0)