ASP.NET development actual combat - (a) opening - Create an ASP.NET Web program with VS

     This article is the first article of this series, mainly through the establishment of a default ASP.NET MVC project to elicit function associated with the ASP.NET MVC, ASP.NET MVC due to a simple template with the database operations, authentication, data input verification and other functions, so this series will be seen as a function of these "magic" introduced one by one.

  This paper to complaint about the following aspects:

  ● Why write this series of articles
  ● Create an ASP.NET MVC application with VS2017
  to run and show the effect of the project ●

Why write this series of articles?

  •   This series of articles based on ASP.NET MVC, ASP.NET Core has been released in version 2.0, why micro-filled service today also wrote ASP.NET? .

  A: Although it is already there and ASP.NET Core micro-service architecture for the mainstream, but there are still a lot of production to develop applications using ASP.NET, ASP.NET so for maintenance is also very important, in addition to ASP. NET Core after all, many things are still based on the idea of ​​ASP.NET, ASP.NET understand the learning Core will go more with less, the additional use of a technology to develop applications, not all businesses are suitable for micro-service architecture, micro Moreover, not only service only just development services, its development and operation and maintenance requirements have great, so this monomer MVC program still has the meaning of existence (ASP.NET Core also has MVC).

  •   The network has a lot of great ASP.NET MVC tutorial, why write?

  A: First thing individuals on the network feel more fragmented, introduced in the MVC MVC introduction, introduced EF EF are introduced, but a development application actually contains a lot of things, not just technology also includes the management (Note: Although this series of articles also talk about technology ...). So this series to develop a blog application as an example, to use the content development process ASP.NET MVC encountered such as EF, Identity and components such as ASP.NET MVC itself.

  More importantly, writing more in-depth understanding of their knowledge of ASP.NET and find problems to enhance their own, these things look to be helpful.

 

Creating a ASP.NET MVC application with Visual Studio 2017.

  Visual Studio 2017 is Microsoft developed a very powerful development tool, it is also preferred .Net IDE developers.

  Download: https://www.visualstudio.com/zh-hans/ 

  This article describes how to use VS2017 to quickly develop an ASP.NET MVC application.

Creating a ASP.NET MVC project

  1. Open the VS2017, create a project via the menu:

  

   ASP.NET Web Application (.NET Framework) 2. find in the project template and modify the Web is selected under the project name and other information to create a path click "OK" to create the project. (Note: Do not use ASP.NET Core)

  

  3. Select the type of Web applications use a separate user authentication for the MVC, authentication, and click "OK" to complete the project creation.

  

  Modify the authentication methods:

  

  4. Project file structure:

  

Running the Project

  1. Select the "Debug" mode, click on the Run button to start the program:

  

     2. Home effects:

  

 

  3. User registration information and input validation (first registration need to wait for some time, as it will create a database):

  

 

  4. User login:

  

  login successful:

  

  Note: Registered users are in the database, restart the application so data is not lost memory. The following is added via server database file and view data window VS2017 method:

  1. Add a SQL Server database file connection.

  

  2. Specify the file path:

  

  3. View data:

  

 

ASP.NET in magic?

  This series of articles to "ASP.NET is no magic" in the title because. As can be seen from the above example, simply by VS can create a fully functional MVC Web application, it not only includes the database operations and user authentication, but also to achieve a user input validation (verify front-end and back-end verification). Microsoft Getting Started document describes how to use ASP.NET MVC to develop applications, what is there something more mechanisms such as routing layers of code? Binding Validation of the model is how? How static content is processed? It is how access to the database? How page rendering? Etc., are not illustrated by an example, this series of articles this series regarded as "magic", by interpreting these "magic" to understand how ASP.NET program is running.

 

reference:

  https://docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/introduction/getting-started

 

Welcome to add a personal Micro Signal: Like if thoughts.

I welcome the attention of the public numbers, not only recommend the latest blog for you, there are more surprises waiting for you and resources! Learn together and common progress!

 

Guess you like

Origin www.cnblogs.com/cool2feel/p/11529099.html