Entry-level. NET MVC Instances

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.