Thông tin tài liệu
www.dbebooks.com - Free Books & magazines
www.it-ebooks.info
Professional
ASP.NET MVC 1.0
Enhance Your Knowledge
Advance Your Career
ASP.NET MVC 1.0 Website Programming
Problem - Design - Solution
978-0-470-41095-0
A hands-on guide to creating ASP.NET websites using MVC. The
complete example site is based on updating Marco Bellinaso’s
TheBeerHouse ASP.NET 2.0 application MVC.
Professional ASP.NET MVC 1.0
978-0-470-38461-9
Professional ASP.NET MVC 1.0 is a step-by-step tutorial on the theory
and approach for using ASP.NET MVC, and is full of real-world examples
for experienced developers to use in porting and creating their current
ASP.NET web sites. The tutorials are wrapped around growing a real-
world application using MVC, and feature toolsets and technologies that
compliment MVC such as SubSonic, LINQ, jQuery, and REST.
Professional ASP.NET 3.5 AJAX
978-0-470-39217-1
Discover how to use the ASP.NET AJAX features to create richer, more
responsive dynamic web sites. This book explains the architecture,
including the ASP.NET server elements and the client-side Javascript
library and runtime, and it walks the user through examples for each
feature element demonstrating how the client and server interact to
produce a better web application.
Professional ASP.NET 3.5 SP1: In C# and VB
978-0-470-47826-4
Updated edition of the bestselling ASP.NET book, expanded to cover
key SP1 data features including. ADO.NET Entity Framework, ADO.NET
Dynamic Data, and ADO.NET Data Services. This SP1 edition also adds
updated ASP.NET AJAX and jQuery coverage, a CD-ROM with free Wrox
Blox and a PDF of the book, and a hardcover for durability.
Beginning ASP.NET MVC 1.0
978-0-470-43399-7
Beginning ASP.NET MVC 1.0 is for developers who have .NET and ASP.NET experience, but want to enhance their level of
knowledge and need to learn about the MVC framework. The book covers all the main topics about ASP.NET MVC, and applies
all of the latest Microsoft technologies to demonstrate the benefits of its usage.
Beginning ASP.NET 3.5: In C# and VB
978-0-470-18759-3
Beginning ASP.NET 3.5 helps readers learn to build dynamic database driven web sites using ASP.NET 3.5. Starting from
scratch, the reader will progressively learn how to design and create web sites with interactive elements. After reading this book,
the reader should be able to build a database driven web site on her own, using best practices and current standards.
spine=.912"
Get more out of
WROX.com
Programmer to Programmer
™
Interact
Take an active role online by participating in
our P2P forums
Wrox Online Library
Hundreds of our books are available online
through Books24x7.com
Wrox Blox
Download short informational pieces and
code to keep you up to date and out of
trouble!
Chapters on Demand
Purchase individual book chapters in pdf
format
Join the Community
Sign up for our free monthly newsletter at
newsletter.wrox.com
Browse
Ready for more Wrox? We have books and
e-books available on .NET, SQL Server, Java,
XML, Visual Basic, C#/ C++, and much more!
Contact Us.
We always like to get feedback from our readers. Have a book idea?
Need community support? Let us know by e-mailing wrox-partnerwithus@wrox.com
www.it-ebooks.info
Professional ASP.NET MVC 1.0
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Chapter 1: NerdDinner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 2: Model-View-Controller and ASP.NET . . . . . . . . . . . . . . . . . . . . . . 165
Chapter 3: ASP.NET > ASP.NET MVC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Chapter 4: Routes and URLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Chapter 5: Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Chapter 6: Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Chapter 7: AJAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Chapter 8: Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Chapter 9: Securing Your Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
Chapter 10: Test Driven Development with ASP.NET MVC . . . . . . . . . . . . . . 349
Chapter 11: Testable Design Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Chapter 12: Best of Both Worlds: Web Forms and MVC Together . . . . . . . . 393
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
84619book.indb Listi84619book.indb Listi 3/30/09 2:56:51 PM3/30/09 2:56:51 PM
www.it-ebooks.info
84619book.indb Listii84619book.indb Listii 3/30/09 2:56:51 PM3/30/09 2:56:51 PM
www.it-ebooks.info
Professional
ASP.NET MVC 1.0
Rob Conery
Scott Guthrie
Phil Haack
Scott Hanselman
84619book.indb Listiii84619book.indb Listiii 3/30/09 2:56:51 PM3/30/09 2:56:51 PM
www.it-ebooks.info
Professional ASP.NET MVC 1.0
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com.
Copyright © 2009 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-38461-9
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Library of Congress Cataloging-in-Publication Data is available from the publisher.
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form
or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as
permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior
written permission of the Publisher, or authorization through payment of the appropriate per-copy
fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax
(978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions
Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax
(201) 748-6008, or online at
www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or war-
ranties with respect to the accuracy or completeness of the contents of this work and specifi cally disclaim all
warranties, including without limitation warranties of fi tness for a particular purpose. No warranty may be
created or extended by sales or promotional materials. The advice and strategies contained herein may not
be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in
rendering legal, accounting, or other professional services. If professional assistance is required, the services
of a competent professional person should be sought. Neither the publisher nor the author shall be liable for
damages arising herefrom. The fact that an organization or web site is referred to in this work as a citation
and/or a potential source of further information does not mean that the author or the publisher endorses the
information the organization or web site may provide or recommendations it may make. Further, readers
should be aware that Internet web sites listed in this work may have changed or disappeared between when
this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department
within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related
trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affi liates, in the
United States and other countries, and may not be used without written permission. All other trademarks
are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or
vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not
be available in electronic books.
84619book.indb Listiv84619book.indb Listiv 3/30/09 2:56:52 PM3/30/09 2:56:52 PM
www.it-ebooks.info
To my sweet wife Kathy, who inspires me everyday.
— Rob Conery
My wife, Akumi, deserves to have her smiling face on the cover as much as I do, for all
her support made this possible. And thanks to Cody for his infectious happiness.
— Phil Haack
Thanks to my wife Mo and my sons Zenzo and Thabo for their unlimited supply of smooches.
— Scott Hanselman
84619book.indb Listv84619book.indb Listv 3/30/09 2:56:52 PM3/30/09 2:56:52 PM
www.it-ebooks.info
About the Authors
Rob Conery works at Microsoft on the ASP.NET team. He is the creator of SubSonic and was the chief
architect of the Commerce Starter Kit (a free, Open Source eCommerce platform for .NET). He lives in
Kauai, Hawaii, with his wife and two daughters (Maddy and Ruby).
Scott Guthrie is corporate vice president of Microsoft’s .NET Developer Division, where he runs the
development teams responsible for delivering Microsoft Visual Studio developer tools and Microsoft .NET
Framework technologies for building client and Web applications. A founding member of the .NET project,
Guthrie has played a key role in the design and development of Visual Studio and the .NET Framework
since 1999. Guthrie is also responsible for Microsoft’s web server platform and development tools teams.
He has also more recently driven the development of Silverlight — a cross browser, cross platform plug-in
for delivering next generation media experiences and rich Internet applications for the Web. Today, Guthrie
directly manages the development teams that build the Common Language Runtime (CLR), ASP.NET,
Silverlight, Windows Presentation Foundation (WPF), IIS, Commerce Server, and the Visual Studio Tools
for web, client, and Silverlight development. Guthrie graduated with a degree in computer science from
Duke University.
Phil Haack is a senior program manager with the ASP.NET team working on the ASP.NET MVC project.
Prior to joining Microsoft, Phil worked as a product manager for a code search engine, a dev manager
for an online gaming company, and a senior architect for a popular Spanish language television net-
work, among other crazy pursuits. As a code junkie, Phil Haack loves to craft software. Not only does he
enjoy writing software, but he also enjoys writing about software and software management on his blog,
http://haacked.com. In his spare time, Phil contributes to various Open Source projects and is the
founder of the Subtext blog engine project, which is undergoing a rewrite, using ASP.NET MVC, of course.
Scott Hanselman works for Microsoft as a principal program manager in the Developer Division,
aiming to spread the good word about developing software, most often on the Microsoft stack.
Before this, he worked in eFinance for 6+ years and before that he was a principal consultant and a
Microsoft Partner for nearly 7 years. He was also involved in a few things like the MVP and RD pro-
grams and will speak about computers (and other passions) whenever someone will listen to him.
He blogs at
www.hanselman.com and podcasts at www.hanselminutes.com and contributes to sites
like
www.asp.net, www.windowsclient.net, and www.silverlight.net. You can also fi nd him
on Twitter, far too often.
84619book.indb Listvi84619book.indb Listvi 3/30/09 2:56:52 PM3/30/09 2:56:52 PM
www.it-ebooks.info
Associate Publisher
Jim Minatel
Development Editor
Maureen Spears
Technical Editors
Levi Broderick
Darren Kindberg
Production Editor
Kathleen Wisor
Copy Editor
Foxxe Editorial Services
Editorial Manager
Mary Beth Wakefi eld
Production Manager
Tim Tate
Vice President and Executive Group Publisher
Richard Swadley
Vice President and Executive Publisher
Barry Pruett
Project Coordinator, Cover
Lynsey Stanford
Compositor
Craig Woods, Happenstance Type-O-Rama
Proofreader
Nancy C. Hanger, Windhaven
Indexer
J&J Indexing
Credits
84619book.indb Listvii84619book.indb Listvii 3/30/09 2:56:52 PM3/30/09 2:56:52 PM
www.it-ebooks.info
Acknowledgments
Thanks to my wife for her unfl agging support. When Scott Guthrie showed me this “pet project,”
I told him I just had to work on it, so thanks to The Gu for helping to make that possible. Thanks to
Levi Broderick for all his editing help, to Brad Wilson for reviewing the chapter on TDD (I still owe you
a beer or two), to Eilon Lipton, the lead developer on ASP.NET MVC, for all his deep insight, and to the
rest of the MVC feature team (Carl, Fede, Jon, Keith, Simon etc.) for being so much fun to work with.
— Phil Haack
Thanks to The Gu, and my boss Simon for their support in working on this book. Thanks to Phil Haack,
Eilon Lipton, Levi Broderick, and all the ASP.NET MVC guys for making such a rockin’ sweet framework.
— Scott Hanselman
84619book.indb Listviii84619book.indb Listviii 3/30/09 2:56:52 PM3/30/09 2:56:52 PM
www.it-ebooks.info
[...]... 2: Model-View-Controller and ASP.NET What Is Model-View-Controller? MVC on the Web Today Ruby on Rails Django and Python Spring, Struts, and Java Zend Framework and PHP MonoRail ASP.NET MVC: The New Kid on the Block Serving Methods, Not Files Is This Web Forms 4.0? Why Not Web Forms? Cost/Benefit of Web Forms Should You Fear ASP.NET MVC? Summary Chapter 3: ASP.NET > ASP.NET MVC Abstraction: What Web Forms... “Chapter 1 “NerdDinner” from Professional ASP.NET MVC 1.0 written by Rob Conery, Scott Hanselman, Phil Haack, Scott Guthrie published by Wrox (ISBN: 978-0-470-38461-9) may be redistributed under the terms of Creative Commons Attribution No Derivatives 3.0 license The original electronic copy is available at http://tinyurl.com/aspnetmvc The complete book Professional ASP.NET MVC 1.0 is copyright 2009 by... the MVC pattern and how ASP.NET MVC implements that pattern Chapter 1 starts off with a description of the Model-View-Controller pattern, explaining the basic concepts of the pattern and providing a bit of its history The chapter goes on to describe the state of the MVC pattern on the Web today as it is implemented by various frameworks, such as ASP.NET MVC Chapter 2 covers the ways that ASP.NET MVC. .. Angle Brackets Client IDs Testing Back to Basics: ASP.NET MVC Believes Orchestration versus Composing Separation of Concerns: What It Means Approaches to Maintainability Caring About Testability Common Reactions to ASP.NET MVC This Looks Like Classic ASP from 1999! Who Moved My “ Yet Another Web Framework Why “ (ASP.NET > ASP.NET MVC) == True” Convention over Configuration Your... familiar with ASP.NET Web Forms, at least peripherally There are a lot of ASP.NET Web Forms developers out there who are interested in ASP.NET MVC, so there are a number of places in this book where we contrast the two technologies Even if you’re not already an ASP.NET developer, you might still find these sections interesting for context, as well as for your own edification, as ASP.NET MVC may not be... the same way about ASP.NET MVC Not because it’s “something different” but because it offers developers the ultimate chance to “do it their way.” You don’t like the way the platform renders the View? Change it! Just about every part of the ASP.NET MVC Framework is “swappable” — if the shoes pinch, get different shoes Don’t like ties? Why not a bow tie? You’re totally in control ASP.NET MVC is a web framework... 2 covers the ways that ASP.NET MVC is different from ASP.NET Web Forms and how to get ASP.NET MVC up and running Chapter 3 explores the structure of a standard MVC application and covers what you get out of the box It covers some of the conventions and the digs a little under the hood to take a look at the entire request lifecycle for an ASP.NET MVC request Chapter 4 digs deep into routing to describe... one of those developers, or even if you’re just curious, this book is for you MVC allows for (buzzword alert!) a “greater separation of concerns” between components in your application We’ll go into the ramifications of this later on, but if it had to be said it in a quick sentence: ASP.NET MVC is ASP.NET Unplugged ASP.NET MVC is a tinkerer’s framework that gives you very finegrained control over your... to Test Driven Development (TDD) as it applies to ASP.NET MVC It then goes on to examine real-world patterns and practices for building applications that are testable The final part of the book covers guidance and best practices as well as providing a look ahead at the future of the ASP.NET MVC platform Chapter 12 goes into detail on how Web Forms and MVC fit together and covers ways to have the two coexist... same application, as well as how to migrate an app from Web Forms to MVC We tried to organize the book in such a way that when you read it in order, each chapter builds on the previous one If you already familiar with ASP.NET MVC you might skip directly to Chapter 4 and go from there What You Need to Use This Book To use ASP.NET MVC, you’ll probably want a copy of Visual Studio You can use Visual Studio . MVC.
Professional ASP. NET MVC 1. 0
978 -0- 4 70- 384 61- 9
Professional ASP. NET MVC 1. 0 is a step-by-step tutorial on the theory
and approach for using ASP. NET. magazines
www.it-ebooks.info
Professional
ASP. NET MVC 1. 0
Enhance Your Knowledge
Advance Your Career
ASP. NET MVC 1. 0 Website Programming
Problem - Design - Solution
978 -0- 4 70- 4 10 95 -0
A
Ngày đăng: 15/03/2014, 07:20
Xem thêm: Professional ASP.NET MVC 1.0 pot, Professional ASP.NET MVC 1.0 pot, ASP.NET MVC: The New Kid on the Block, Chapter 10: Test Driven Development with ASP.NET MVC