Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 516 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
516
Dung lượng
10,95 MB
Nội dung
[...]... understanding of ASP. NET development Who should not read this book If you’re looking for a step-by-step guide to ASP. NET MVC, this is not the ideal book for you Organization of this book This book is divided into three sections Part I, ASP. NETMVC fundamentals,” provides a quick overview of the foundation of ASP. NET and its core components Part II, ASP. NETMVC software design,” focuses on common aspects of... going! We’re on Twitter: http://twitter.com/MicrosoftPress Introduction xvii PAR T I ASP. NETMVC fundamentals CHAPTER 1 ASP. NETMVC controllers 3 CHAPTER 2 ASP. NETMVC views 33 CHAPTER 3 The model-binding architecture 75 CHAPTER 4 Input forms 103 1 CHAPTER 1 ASP. NETMVC controllers They always say time changes... deal with more generic URIs, whereas ASP. NET Web Forms was designed to deal with location-aware physical resources Simulating the ASP. NETMVC runtime Let’s build a simple ASP. NET Web Forms application and use HTTP handlers to figure out the internal mechanics of ASP. NETMVC applications You can start from the basic ASP. NET Web Forms application you get from your Microsoft Visual Studio project manager... mentioned, offers its services to both ASP. NETMVC and ASP. NET Web Forms applications, though through a slightly different API Routing the requests What happens exactly when a request knocks at the Internet Information Services (IIS) gate? Figure 1-2 gives you an overall picture of the various steps involved and how things work differently in ASP. NETMVC and ASP. NET Web Forms applications The URL routing... using Web Forms, for today’s web development, ASP. NETMVC is a much better choice You don’t need to invest a huge amount of time, but you need to understand exactly what’s going on and the philosophy behind MVC If you do that, any investment you make will pay you back sooner than you expect 3 Note This book is based on ASP. NET MVC 5 This version of ASP. NET MVC is backward compatible with the previous... String.Format(message, param1); } } } Figure 1-1 shows the effect of invoking a page-agnostic URL in an ASP. NET Web Forms application 6 PART I ASP. NET MVC fundamentals FIGURE 1-1 Processing page-agnostic URLs in ASP. NET Web Forms This simple example demonstrates the basic mechanics used by ASP. NET MVC The specialized component that serves a request is the controller The controller is a class with just... latest version of ASP. NET 4 Web Forms, you can use URL routing to match incoming URLs to other URLs without incurring the costs of HTTP 302 redirects Conversely, in ASP. NET MVC, URL routing serves the purpose of mapping incoming URLs to a controller class and an action method Note Originally developed as an ASP. NETMVC component, the URL routing module is now a native part of the ASP. NET platform and,... works today The ASP. NET run-time environment, however, doesn’t limit you to just calling into resources identified by a specific location and file By writing an ad hoc HTTP handler and binding it to a URL, you can use ASP. NET to execute code in response to a request regardless of the dependencies on physical files This is just one of the aspects that most distinguishes ASP. NETMVC from ASP. NET Web Forms... post-exercise formats, from the following page: http://aka.ms/programASP -NET_ MVC/ files Follow the instructions to download the asp- net- mvc- examples.zip file Installing the code samples Perform the following steps to install the code samples on your computer so that you can use them with the exercises in this book 1 Unzip the asp- net- mvc- examples.zip file that you downloaded from the book’s website (name... even though ASP. NETMVC addresses more closely the present needs of developers The most common scenario of Web Forms is applications for which you focus on presenting data and use some third-party high-quality suite of controls for that ASP. NETMVC is for everything else, including the scaffolding of client-side single-page applications The way web applications are changing proves that ASP. NETMVC probably . 1 ASP. NET MVC controllers 3 CHAPTER 2 ASP. NET MVC views 33 CHAPTER 3 The model-binding architecture 75 CHAPTER 4 Input forms 103 PART II ASP. NET MVC SOFTWARE DESIGN CHAPTER 5 Aspects of ASP. NET. page: http://aka.ms/programASP -NET_ MVC/ les Follow the instructions to download the asp- net- mvc- examples.zip le. Installing the code samples Perform the following steps to install the code samples on your computer. . . . . . . . . . . . . . . . . . . . . . .146 PART II ASP. NET MVC SOFTWARE DESIGN Chapter 5 Aspects of ASP. NET MVC applications 151 ASP. NET intrinsic objects 151 HTTP response and SEO 152 Managing