Apress.Beginning.Web.Development.Silverlight.And.ASP.NET.AJAX.Feb.2008-sUppLeX.

450 568 0
Apress.Beginning.Web.Development.Silverlight.And.ASP.NET.AJAX.Feb.2008-sUppLeX.

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Apress.Beginning.Web.Development.Silverlight.And.ASP.NET.AJAX.Feb.2008-sUppLeX.

this print for content only—size & color not accurate spine = 0.850" 448 page countBooks for professionals By professionals®Beginning Web Development, Silverlight, and ASP.NET AJAX: From Novice to ProfessionalDear Reader,Just when you think you’ve learned all there is to know about developing for the Web, the market turns around and demands newer and more exciting things! It’s pretty clear that the landscape hasn’t settled down, and is a long way from doing so.This book was designed with new and experienced developers in mind—to take you back to the important basics, to build a platform on which you’ll build your platforms, and to start equipping you for what’s next. As such, you’ll start by looking through HTML and dynamic generation of HTML using ASP.NET technology. You’ll learn key fundamental aspects of ASP.NET, such as web forms, data binding, and deploying ASP.NET applications using IIS. Next, you’ll look at .NET 3.x (WCF, WPF, WF, and CardSpace) and what it adds to your toolbox with technologies for presentation, connectivity, workflow, and security. After you’ve established a good foundation of these topics, you’ll move on to ASP.NET AJAX. You’ll take a peek under the covers of Ajax and look at what makes it so special. You’ll also see how Ajax eases the programming burden in creating a powerful UI experience. Finally, you’ll dive into Silverlight and see examples of Silverlight programming with XAML and JavaScript.By the time you’ve finished reading, you’ll be prepared for what’s next.Welcome aboard!Laurence MoroneyAuthor ofIntroducing Microsoft Silverlight 1.0, Foundations of ASP.NET AJAX, Foundations of WPF, Foundations of AtlasUS $44.99Shelve in Web Development User level: Beginner–IntermediateMoroneyWeb Development, Silverlight,and ASP.NET AJAXThe eXperT’s Voice® in .neTBeginningWeb Development, Silverlight, andASP.NET AJAXFrom Novice to Professional cyan MaGenTa yelloW Black panTone 123 cLaurence MoroneyCompanion eBook AvailableTHE APRESS ROADMAPSilverlight and ASP.NETRevealedFoundations ofASP.NET AJAXPro ASP.NET 3.5in C# 2008Pro ASP.NET 3.5Server Controls withAJAX ComponentsPro Silverlight 2.0Ajax Patternsand Best PracticesBeginning WebDevelopment, Silverlight,and ASP.NET AJAXwww.apress.comSOURCE CODE ONLINECompanion eBook See last page for details on $10 eBook versionISBN-13: 978-1-59059-959-4ISBN-10: 1-59059-959-49 781590 5995945 4 4 9 9Learn how to build web applications using ASP.NET AJAX, WPF, WCF, and WF, as well as Silverlight.Beginning Laurence MoroneyBeginning Web Development,Silverlight, and ASP.NET AJAXFrom Novice to Professional9594FM.qxd 2/8/08 2:45 PM Page i Beginning Web Development, Silverlight, and ASP.NET AJAX: From Novice to ProfessionalCopyright © 2008 by Laurence MoroneyAll rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,electronic or mechanical, including photocopying, recording, or by any information storage or retrievalsystem, without the prior written permission of the copyright owner and the publisher.ISBN-13 (pbk): 978-1-59059-959-4ISBN-10 (pbk): 1-59059-959-4ISBN-13 (electronic): 978-1-4302-0582-1ISBN-10 (electronic): 1-4302-0582-2Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrenceof a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademarkowner, with no intention of infringement of the trademark.Lead Editor: Kevin GoffTechnical Reviewers: Fabio Claudio Ferracchiati, Bob LairEditorial Board: Clay Andres, Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell,Jonathan Gennick, Kevin Goff, Matthew Moodie, Joseph Ottinger, Jeffrey Pepper, Frank Pohlmann,Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom WelshProject Manager: Richard Dal PortoCopy Editor: Damon LarsonAssociate Production Director: Kari Brooks-CoponyProduction Editor: Ellie FountainCompositor: Dina QuanProofreader: April EddyIndexer: Brenda MillerArtist: Kinetic Publishing Services, LLCCover Designer: Kurt KramesManufacturing Director: Tom DebolskiDistributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com, orvisit http://www.springeronline.com. For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600,Berkeley, CA 94705. Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com, or visithttp://www.apress.com. Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use.eBook versions and licenses are also available for most titles. For more information, reference our SpecialBulk Sales–eBook Licensing web page at http://www.apress.com/info/bulksales.The information in this book is distributed on an “as is” basis, without warranty. Although every precau-tion has been taken in the preparation of this work, neither the author(s) nor Apress shall have anyliability to any person or entity with respect to any loss or damage caused or alleged to be caused directlyor indirectly by the information contained in this work. The source code for this book is available to readers at http://www.apress.com. 9594FM.qxd 2/8/08 2:45 PM Page ii I’d like to dedicate this book to my family: my wife, Rebecca, and mywonderful children, Claudia and Christopher. I’d also like to dedicate itto the one who has made all this possible. John 3:169594FM.qxd 2/8/08 2:45 PM Page iii 9594FM.qxd 2/8/08 2:45 PM Page iv2ca983ba3745582e6151dc1b079b2db0 Contents at a GlanceAbout the Author. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvAbout the Technical Reviewer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviiIntroduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xixPART 1■ ■ ■Building Web Applications ■CHAPTER 1 Introduction to Web Development. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3■CHAPTER 2 Basics of Web Development with ASP.NET. . . . . . . . . . . . . . . . . . . . . . 9■CHAPTER 3 Web Forms with ASP.NET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37■CHAPTER 4 Data Binding with ASP.NET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69■CHAPTER 5 ASP.NET Web Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105■CHAPTER 6 Deploying Your Web Site. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129PART 2■ ■ ■Next Generation Technologies forWeb Development■CHAPTER 7 .NET 3.0: Windows Communication Foundation. . . . . . . . . . . . . . . . 155■CHAPTER 8 .NET 3.0: Windows Presentation Foundation. . . . . . . . . . . . . . . . . . . 177■CHAPTER 9 .NET 3.0:Windows Workflow Foundation. . . . . . . . . . . . . . . . . . . . . . 209■CHAPTER 10 .NET 3.0: Programming with CardSpace. . . . . . . . . . . . . . . . . . . . . . . 233■CHAPTER 11 Ajax Applications and Empowering the Web User Experience. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253■CHAPTER 12 AJAX Extensions for ASP.NET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279■CHAPTER 13 Ajax Scripts and Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309■CHAPTER 14 JavaScript Programming with ASP.NET AJAX. . . . . . . . . . . . . . . . . . 331■CHAPTER 15 Enhancing the Web Experience with Silverlight. . . . . . . . . . . . . . . . 353■CHAPTER 16 Programming Silverlight with XAML and JavaScript. . . . . . . . . . . . 375■INDEX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415v9594FM.qxd 2/8/08 2:45 PM Page v 9594FM.qxd 2/8/08 2:45 PM Page vi ContentsAbout the Author. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvAbout the Technical Reviewer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviiIntroduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xixPART 1■ ■ ■Building Web Applications ■CHAPTER 1Introduction to Web Development. . . . . . . . . . . . . . . . . . . . . . . . . . 3The Internet and the Birth of the Web. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Going Beyond the Static Web. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6The Arrival of ASP.NET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8■CHAPTER 2Basics of Web Development with ASP.NET. . . . . . . . . . . . . . . . . 9Using Visual Studio. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Creating the Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Exploring the IDE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Visual Studio and Solutions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17The Code and Design Windows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Architecture of ASP.NET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32The ASP.NET Worker Process and State Management. . . . . . . . . . . 33Using the Web Configuration File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36■CHAPTER 3Web Forms with ASP.NET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Understanding Page Processing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Looking at Web Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39HTML Forms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39An HTML Forms Example in ASP.NET. . . . . . . . . . . . . . . . . . . . . . . . . 41Using a Server Control to Provide Feedback. . . . . . . . . . . . . . . . . . . . 46vii9594FM.qxd 2/8/08 2:45 PM Page vii Using ASP.NET Events and Automatic Postbacks. . . . . . . . . . . . . . . 52View State. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Processing Web Forms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56Page Framework Initialization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57Application Code Initialization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57Performing Validation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58Performing Event Handling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58Performing Data Binding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Server Tidies Up Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Pages and Controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Accessing the Page Head. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62Creating Controls at Runtime. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64The Page Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66The Request Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66The Response Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67■CHAPTER 4Data Binding with ASP.NET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69What Is ADO.NET?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69Using ADO.NET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70SQL Server 2005 Express. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71Downloading and Installing SQL Server 2005 Express. . . . . . . . . . . 72Starting the Install. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72Using SQL Server Management Studio Express. . . . . . . . . . . . . . . . . 78Installing the AdventureWorks Database. . . . . . . . . . . . . . . . . . . . . . . 79Using ADO.NET to Build Data-Driven Applications. . . . . . . . . . . . . . . . . . . . 82The Connection Class and Connection Strings. . . . . . . . . . . . . . . . . . 82Using Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86Data Binding with Server Controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91Using the SQLDataSource Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . 92Using the GridView Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96Using the DataList Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103■CONTENTSviii9594FM.qxd 2/8/08 2:45 PM Page viii . APRESS ROADMAPSilverlight and ASP. NETRevealedFoundations ofASP .NET AJAXPro ASP. NET 3.5in C# 2008Pro ASP. NET 3.5Server Controls withAJAX ComponentsPro Silverlight. Beginner–IntermediateMoroneyWeb Development, Silverlight, and ASP. NET AJAXThe eXperT’s Voice® in .neTBeginningWeb Development, Silverlight, andASP .NET AJAXFrom Novice to Professional

Ngày đăng: 15/11/2012, 14:20

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan