http://xiangai.taobao.com
http://shop148612228.taobao.com
摘要: Implementing Edit, Details, and Delete ViewsOpen the Movie controller and add the following Details method:public ActionResult Details(int id) { Movie movie = db.Movies.Find(id); if(movie == null) return RedirectToAction("Index"); return View("Details", movie);}The code-first app 阅读全文
posted @ 2011-01-22 18:06 万事俱备就差个程序员 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Adding a New Field to the Movie Model and TableIn this section you'll see how easy it is to evolve the schema of our database by simply adding another field to the Movie class. Open the Movie class and add a Rating property (column) that has a StringLength attribute applied to it:[StringLength(5 阅读全文
posted @ 2011-01-22 18:04 万事俱备就差个程序员 阅读(290) 评论(0) 推荐(0) 编辑
摘要: Adding Validation to the ModelIn this section we're going to implement the support necessary to enable input validation in the application. We'll ensure that database content is correct and provide helpful error messages to end users when they try to enter movie data that isn't valid. We 阅读全文
posted @ 2011-01-22 18:03 万事俱备就差个程序员 阅读(212) 评论(0) 推荐(0) 编辑
摘要: Adding a Create Method and Create View In this section we're going to implement the support necessary to enable users to create new movies in the database. We'll do this by creating a controller action method that we can call using /Movies/Create on the end of the URL.Implementing the code t 阅读全文
posted @ 2011-01-22 18:00 万事俱备就差个程序员 阅读(230) 评论(0) 推荐(0) 编辑
摘要: Accessing your Model's Data from a ControllerIn this section, you'll create a new MoviesController class and write code that retrieves the movie data and displays it in the browser using a view template. Right-click the Controllers folder and make a new MoviesController class.This creates a 阅读全文
posted @ 2011-01-22 17:56 万事俱备就差个程序员 阅读(195) 评论(0) 推荐(0) 编辑
摘要: Entity Framework Code-First DevelopmentThe Entity Framework version 4 supports a development paradigm called code-first. Code-first allows you to create model object by writing simple classes (also known as POCO, from "plain-old CLR objects") and have the database created on the fly from y 阅读全文
posted @ 2011-01-22 17:55 万事俱备就差个程序员 阅读(303) 评论(0) 推荐(0) 编辑
摘要: Adding a ViewIn this section we're going to modify the HelloWorldController class to use a view template file to cleanly encapsulate the process of generating HTML responses to a client.Let's start by using a view template with the Index method in the HelloWorldController class. Currently th 阅读全文
posted @ 2011-01-22 17:52 万事俱备就差个程序员 阅读(289) 评论(0) 推荐(0) 编辑
摘要: Adding a ControllerMVC stands for model-view-controller. MVC is a pattern for developing applications such that each part has a separate responsibilit... 阅读全文
posted @ 2011-01-22 17:47 万事俱备就差个程序员 阅读(226) 评论(0) 推荐(0) 编辑
摘要: This tutorial will teach you the basics of building an ASP.NET MVC Web application using Microsoft Visual Web Developer Express, which is a free version of Microsoft Visual Studio. Before you start, make sure you have the prerequisites listed above installed using the Web Platform Installer.You' 阅读全文
posted @ 2011-01-22 17:45 万事俱备就差个程序员 阅读(271) 评论(0) 推荐(0) 编辑

http://xiangai.taobao.com
http://shop148612228.taobao.com
如果您觉得对您有帮助.领个红包吧.谢谢.
支付宝红包
微信打赏 支付宝打赏