Project starting point (requirement) registration
I. Demand analysis Users
Two. Design
Three. Implementation (coding phase): dbmy
1. Implementing the Database: Users
Create a database, create a table, and put the necessary initial test data as needed
2. Code implementation
Step A. Create a new project-ASP. NET MVC Template
Step b. Write the configuration file, set the connection string
Step c. The steps to complete the registration function and addition are similar to the steps of using addition 2
C.1>
Create model users, compile
[Basic correspondence of the entity class and the table in the database]
C.2>
Create controller Users
[Controller-noun]
Create method (Register) method name register
[Whether this feature is: interactivity] or: One request or two related requests
If it is two requests, define a pair of methods with the same name (overloads of the method)
[HttpGet] [HttpPost]
C.3>
1>
Create views, try names best and method names
[Best to create strongly typed views]
2>
Design view to implement input submissions
[View template-common notation]
In the controller two methods set the short point, test!
[Note Modify Global.asax file]
3>
Continue to design the perfect view
C.4>
The method of implementing the Post method body!
A.
Steps in the method body:
1>
Get input, auto complete [model binding]
2>
Processing
Preliminary treatment, primary treatment of core processing (verification, necessary modification)
3>
Output
B.
Core processing, if you want to implement and database interaction, then in the Model folder to add
Entity Access class: Userdal[? DAL]
Method parameters (Entity class object name)
Data access classes: SqlHelper, entities can be reused
Method parameters (String sql)
C.
Implementing Entity Access classes (4OP: adding and deleting)
D.
Implementing a Data Access class (select modification)
E.
Go back to the controller post method and call it.
Complete the Post method completely!
007.MVC Project Development Steps