Document directory
- I. Purpose of this Article
- Ii. Summary of Movie Database applications
- Iii. Preparations
- 4. Create an ASP. net mvc application
- 5. Create related databases
This document is translated into an article on the MVC official website. The original address of this article is http://www.asp.net/learn/mvc/tutorial-21-cs.aspx. the original article is: Create a Movie Database Application in 15 minutes with ASP. net MVC (C #). If the English level is acceptable, you can directly read the original article. If you do not like your own translation, then follow me.
I. Purpose of this Article
The purpose of this article is to teach you how to build ASP. net MVC application. In this article, I will create a complete ASP. net MVC application, I will show you how to create a simple Movie Database driver application, this application shows you how to list database content, how to add database content, and how to edit database content.
To simplify the process of creating our applications, we must take full advantage of Visual Studio 2008. We will take advantage of Visual Studio for our contriller, Model) and view to generate the initial code and content.
If you are familiar with ASP or ASP. net, you will be very easy to access ASP. net MVC, Asp. the view part of the net MVC application is similar to the page in ASP, and also similar to ASP. net web form application, Asp. net MVC through. net Framework provides you with a wide range of languages and classes.
My wish is that this article will allow you to create ASP. net MVC applications have a deep understanding, although ASP. net MVC applications and ASP. net is similar or different.
Ii. Summary of Movie Database applications
Because our goal is to simplify all transactions, we only create a very simple movie database application. Our simple application allows us to do three things:
1. List Movie Database records;
2. Add new records to the Movie Database;
3. Edit an existing Movie Database record
In addition, for simplicity, we only use the minimal features of the ASP. net mvc framework, and we do not use test-driven development.
To create an application, follow these steps:
1. Create an ASP. net mvc web application project;
2. Create a database
3. Create a database model
4. Create an ASP. net mvc Controller)
5. Create an ASP. net mvc view (view)
Iii. Preparations
You need to use Visual Studio 2008 or visual web developer 2008 express to create an ASP. net mvc application. You can also download the ASP. net mvc framework.
1. If Visual Studio 2008 is not installed, you can download the 90-day real-time version of Visual Studio 2008. The URL is:
Http://msdn.microsoft.com/en-us/vs2008/products/cc268305.aspx
2. Of course, you can also use Visual Web Developer 2008 express to create ASP. net MVC application. If you decide to use visual web developer 2008 Express, you must have the SP1 Installer. You can download Visual Web Developer 2008 express with SP1 from the following URL:
Http://www.microsoft.com/downloads/details.aspx? Familyid = BDB6391C-05CA-4036-9154-6DF4F6DEBD14 & displaylang = en
3. After Visual Studio 2008 or visual web developer 2008 Express is installed, you need to install the ASP. net mvc Framework, which is:
Http://www.asp.net/mvc/
Note: Apart from downloading and installing ASP. net Framework and ASP. net MVC framework, you can make full use of the Web Platform installer function, web platform application allows you to better and more easily manage the installer in your computer,:
Http://www.microsoft.com/web/gallery/Install.aspx
4. Create an ASP. net mvc application
Previous Article: [ASP. NET topics] (1) -- A Preliminary Study of ASP. net mvc describes in detail how to create your own ASP. net mvc application. We will not repeat it here. Address: http://blog.csdn.net/rocket5725/archive/2010/01/11/5177320.aspx
5. Create related databases
Create a database named moviedb and create a table named movies. The script is as follows:
Use [simpleoa] <br/> go <br/>/***** object: Table [DBO]. [movies] script Date: 01/12/2010 10:50:16 ******/<br/> set ansi_nulls on <br/> go <br/> set quoted_identifier on <br/> go <br/> Create Table [DBO]. [movies] (<br/> [ID] [int] Identity (1,1) not null, <br/> [title] [nvarchar] (100) not null, <br/> [Director] [nvarchar] (100) not null, <br/> [datereleased] [datetime] not null, <br/> constraint [pk_movies] primary key clustered <br/> (<br/> [ID] ASC <br/>) with (pad_index = OFF, statistics_norecompute = off, ignore_dup_key = OFF, allow_row_locks = on, allow_page_locks = on) on [primary] <br/>) on [primary] <br/>