Heard MVC's name, but has not been studied. The most used in the past is the. NET WebForm, which is more accustomed to the three-tier architecture. Since the company will use the MVC framework to do some projects recently, it has also started to engage and learn. Read a few tutorials, roughly understand the general meaning of the m-v-c, a general understanding of the next structure, but have to admit that some specific details of the place and webfrm are still different, here is just a simple example, let it run up. See some examples, most of them are used linqtosql, here is ADO. Feel this more comfortable, hehe.
As a result of the previous PHP program, so the front page display method is easy to understand. Just in the MVC framework, there are some default routing rules (which are, of course, customizable), and this rule is more specific
All right, let's get an example straight!
First, create an empty MVC project, this is MVC version 2.0.
This is named "Firstmvc", which automatically adds the project's directory structure.
Create a new controller under the "controller" directory named "MemberController.cs"
At the same time, add the corresponding view under the "View" directory, and add an index
The operation of the data logic is basically done in the controller, which is implemented in MemberController.cs.
To be more realistic, we also build an entity class under the model directory named Member.cs
All right, get ready for the job, let's do it.
Front desk--view
<%@ page language= "C #" inherits= "system.web.mvc.viewpage<dynamic>"%><! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
"Recommended"
1. Special recommendation : "PHP Programmer Toolkit" V0.1 version download
2. asp free Video Tutorial
3. MYMVC The process of finding action in the box
4. the. NET MYMVC Framework performs an action-detailed procedure
5. the. NET MYMVC Framework How to assign values to a method tutorial
6. .net MYMVC Framework to process return values tutorial