Document types: August 2020 project technical literature
Development tools and key technology: Microsoft visual studio and MVC
Author: Sirius; Grade 2019, grade; Write the date: 2020.8.13
1. The extracurricular knowledge
ASP.NET is a development framework for using HTML, CSS, JavaScript, and server script to build web pages and web site,
ASP.NET support open three patterns: Web Pages, the MVC (Model View Controller) as well as the Web Forms;
2. MVC programming model
MVC is a framework for building web applications, using the model view controller design:
? Model: the core of the application
? View: the data suggest that
? The Control controller: processing input
Other facilities: MVC model at the same time provide for HTML, CSS and javascript complete control
Then we will work together to create a MVC
3. Create a MVC
First of all we need to have Microsoft visual studio, of course, what I use is cracked versions, if you had no resources can also use the visual studio express2010/2010
he is free1 st open our development tools,
2 nd new
3 rd project
4 th choose ASP.NET Web application
5 th _MVC (project name) FJDPXT_MVC storage path name change, click ok
6 th select empty and MVC core, click ok
Good then we will create a simple MVC project
4. To understand the application folder
Application information:
? The Properties
? Refer to
The application folder:
? The App_Data folder: used to store application data
? Content folder: for static to the as CSS stylesheet. Charts. Image
? Controllers folder: controller
? Models folder: model class
? Scripts folder: the class to which the script file
? Views folder: displays the HTML file (user interface)
The configuration file:
? The global.asax
? Packages. The config
? The web.config
Conclusion: all the folder's name in the MVC application is equal, the MVC framework based on the default name, controller used for controllers folder and view in the view folder, model in the models folder, all we don't have to use in your application folder name, standardized naming way to reduce the amount of code, at the same time, is advantageous to the understanding of MVC project developers
5.
The file type is ASP.NET
The file type extension
HTML, HTM or HTML
ASP, ASP
ASP.NET aspx
ASP.NET Razor. C # CSHTML
ASP.NET Razor VB. VBHTML
6. Run you create program
If you created the view page, you can choose to debug, start debugging from the debug menu
Start the shortcut: F5
Close the shortcut: shift + F5
7. Share an example:
The controller page:
Using PartOne. EntityClass;
Using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. The Web;
Using System. Web. Mvc;
Using PartOne. Models;
Using PartOne.Com mon;
Using System. Text. RegularExpressions;
Using System. IO;
Using System. The Transactions;
Using System. The Data;
The namespace PartOne. Controllers
{
Public class MainController: Controller
{
//GET: the Main
///& lt; Summary>
///student information maintenance page
///& lt;/summary>
///& lt; Returns>
Public ActionResult Index ()
{
Return the View ();
}
View page:
@ {
Layout=null;
}
<meta charset="utf-8" & gt;
<meta HTTP - equiv="X - UA - Compatible" content="IE=9" & gt; @ * mode compatible * @
<meta name="viewport" content="width=device - width"/& gt;
<body>