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
- wwwroot : it contains directories (css, images, js, lib), you can call file javascript, the following code below
<script src="~/js/jquery.min.js"></script>
- ViewImports.cshtml: you see it import library
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
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>
- 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"
}
}
The Article : Create Project ASP.NET Core 2.1
Top comments (0)