Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 837 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
837
Dung lượng
12,48 MB
Nội dung
[...]... created a new item called ASP.NET MVC3 Web Application, as shown in Figure 3- 1 Figure 3- 1 The Visual Studio MVC3 project template 31 CHAPTER 3 ■ YOUR FIRST MVC APPLICATION ■ Caution The MVC3 installer doesn’t remove MVC version 2, so you’ll also see the old templates available alongside the new When creating a new project, be careful to select the right one Set the name of the new project to PartyInvites... concepts in MVC The ASP.NETMVCFramework implements the MVC pattern, and in doing so, provides greatly improved separation of concerns In fact, ASP.NETMVC implements a modern variant of MVC that’s especially suitable for web applications You’ll learn more about the theory and practice of this architecture in Chapter 4 By embracing and adapting the MVC pattern, the ASP.NET MVCFramework provides strong... ASP.NET MVC, the MonoRail project is rarely heard of The momentum of enthusiasm and innovation in the NET web development world is now focused on ASP.NETMVC 14 CHAPTER 1 ■ WHAT’S THE BIG IDEA? What’s New in ASP.NET MVC3 The headline feature in MVC version 3 is the introduction of the Razor View Engine Previous versions of MVC have relied on the standard ASP.NET view engine, which depends on the ASP.NET. .. to MVC, you’ll find plenty to keep you interested Where we use something without explaining it, we provide a reference to the chapter where you can find all the details Creating a New ASP.NETMVC Project We are going to start by creating a new MVC project in Visual Studio Select New Project from the File menu to open the New Project dialog If you select the Web templates, you’ll see that the MVC3 installer... 23, you’ll be ready to deploy your MVCFramework application to your server 30 CHAPTER 3 ■■■ Your First MVC Application The best way to appreciate a software development framework is to jump right in and use it In this chapter, you’ll create a simple data-entry application using the ASP.NET MVCFramework We’ll take things a step at a time so you can see how an ASP.NETMVC application is constructed To... treatment for ASP.NET applications Being built on the core ASP.NET platform, MVC applications get all these benefits Chapter 23 explains what you need to know to deploy ASP.NETMVC applications to IIS on Windows Server Modern API Since its inception in 2002, Microsoft’s NET platform has evolved relentlessly, supporting and even defining the state-of-the-art aspects of modern programming ASP.NET MVC3 is built... PartyInvites and click the OK button to continue You will see another dialog box, shown in Figure 3- 2, which asks you to choose between three different types of MVC project templates Figure 3- 2 Selecting a type of MVC3 project The Empty option creates a project with only the minimum files and folders required for an MVC3 application The Internet Application option creates a small example application that you... the new project 32 CHAPTER 3 ■ YOUR FIRST MVC APPLICATION ■ Note Under the template options in Figure 3- 2, you can see a drop-down menu that lets you specify the view engine for the project As we mentioned in Chapter 1, MVC3 includes a new and improved view engine called Razor, which we’ll be using Razor throughout this book We recommend that you do the same But if you want to use the regular ASP.NET. .. this book 33 CHAPTER 3 ■ YOUR FIRST MVC APPLICATION To add a controller to our project, right-click the Controllers folder in the Visual Studio Solution Explorer window and choose Add and then Controller from the pop-up menus, as shown in Figure 3- 4 Figure 3- 4 Adding a controller to the MVC project When the Add Controller dialog appears, set the name to HomeController, as shown in Figure 3- 5 This is... in full-stack frameworks like Ruby on Rails and ASP.NETMVC Node.js is mentioned here only to put some of ASP.NETMVC s design into context against industry trends For example, ASP.NETMVC includes asynchronous controllers (which we describe in Chapter 14) This is a way to handle HTTP requests with nonblocking I/O and scale up to handle more requests per CPU And as you’ll learn, ASP.NETMVC integrates . object- oriented programming Heavy on bandwidth Ugly HTML Untestable 2005 ASP. NET Web Forms 2.0 2007 ASP. NET AJAX 2008 ASP. NET Web Forms 3. 5 2009 ASP. NET MVC 1.0 2010 ASP. NET MVC 2.0 ASP. NET. in MVC. The ASP. NET MVC Framework implements the MVC pattern, and in doing so, provides greatly improved separation of concerns. In fact, ASP. NET MVC implements a modern variant of MVC that’s. ■Part 1: Introducing ASP. NET MVC 3 1 ■Chapter 1: What’s the Big Idea? 3 ■Chapter 2: Getting Ready 17 ■Chapter 3: Your First MVC Application 31 ■Chapter 4: The MVC Pattern 63 ■Chapter 5: Essential