Praise forBuilding a Web 2.0 Portal with ASP.NET 3.5 “Omarandhiscollaboratorshaveappliedtheirawesometalentsandahugeamountoftime to crafting what might be the most advanced web site yet that’s based on ASP.NET and Ajax. In this book, Omar distills everything he’s learned from his experience, going in- depthintodesigngoals,architecture,andimplementation,includingmanypitfallsthathe teaches you how to avoid. If you’re serious about creating a high-performance, modern, Ajax-based ASP.NET web site,Building a Web 2.0 Portal with ASP.NET 3.5 is for you.” —Mike Pope, Microsoft User Education, Microsoft Corporation “An outstanding overview of the technologies, techniques, and best practices involved in working with today’s most popular web application model. Highly recommended for any web developer who wants to stay relevant.” —Craig Wills, Training Manager, Infusion Building a Web 2.0 Portal with ASP.NET 3.5 Other Microsoft .NET resources from O’Reilly Related titles C# 3.0 Cookbook™ Programming ASP.NET C# 3.0 Design Patterns Programming ASP.NET AJAX C# 3.0 in a Nutshell Programming C# 3.0 Learning ASP.NET 2.0 with Programming .NET 3.5 AJAX .NET Books dotnet.oreilly.com is a complete catalog of O’Reilly’s books on Resource Center .NET and related technologies, including sample chapters and code examples. ONDotnet.comprovidesindependentcoverageoffundamental, interoperable,andemergingMicrosoft.NETprogrammingand web services technologies. Conferences O’Reillybringsdiverseinnovatorstogethertonurturetheideas that spark revolutionary industries. We specialize in docu- menting the latest tools and systems, translating the innovator’s knowledge into useful skills for those in the trenches. Visit conferences.oreilly.com for our upcoming events. Safari Bookshelf (safari.oreilly.com) is the premier online refer- ence library for programmers and IT professionals. Conduct searchesacrossmorethan1,000books.Subscriberscanzeroin on answers to time-critical questions in a matter of seconds. Read the books on your Bookshelf from cover to cover or sim- ply flip to the page you need. Try it today for free. Building a Web 2.0 Portal with ASP.NET 3.5 Omar AL Zabir Beijing • Cambridge • Farnham • Köln • Paris • Sebastopol • Taipei • Tokyo Building a Web 2.0 Portal with ASP.NET 3.5 by Omar AL Zabir Copyright © 2008 Omar AL Zabir. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (safari.oreilly.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 [email protected]. Editor: John Osborn Indexer: John Bickelhaupt Production Editor: Laurel R.T. Ruma Cover Designer: Karen Montgomery Copyeditor: Laurel R.T. Ruma Interior Designer: David Futato Proofreader: Mary Brady Illustrators: Robert Romano and Lesley Borash Printing History: December 2007: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc.Building a Web 2.0 Portal with ASP.NET 3.5, the image of a giant green sea anemone, and related trade dress are trademarks of O’Reilly Media, Inc. Microsoft,MSDN,the.NETlogo,VisualBasic,VisualC++,VisualStudio,andWindowsareregistered trademarks of Microsoft Corporation. Manyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedas trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. Whileeveryprecautionhasbeentakeninthepreparationofthisbook,thepublisherandauthorassume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. This book uses RepKover™, a durable and flexible lay-flat binding. ISBN-10: 0-596-51050-0 ISBN-13: 978-0-596-51050-3 [C] Table of Contents Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi 1. Introducing Web Portals and Dropthings.com . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Defining a Web Portal 2 Defining a Web 2.0 Portal 4 Using a Web Portal 4 Navigating Dropthings 5 Using ASP.NET AJAX 8 Using C# 3.0 and .NET 3.5 9 Summary 10 2. Architecting the Web Portal and Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Using a Widget Framework 20 Adding Widgets 26 Maximizing the First-Visit Experience 28 Rendering a Second-Visit Experience 30 Improving ASP.NET AJAX Performance 31 Adding Authentication and Authorization 36 Preventing Denial-of-Service Attacks 38 Summary 40 3. Building the Web Layer Using ASP.NET AJAX . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Implementing the Start Page of a Web Portal 41 Building a Custom Drag-and-Drop Extender for a Multicolumn Drop Zone 60 Implementing WidgetContainer 74 Building Widgets 81 Page Switching: Simulating a Nonpostback Experience 92 vii Using the Profile Object Inside a Web Service 94 Implementing Authentication and Authorization 95 Implementing Logout 98 Summary 100 4. Building the Data and Business Layers Using .NET 3.5 . . . . . . . . . . . . . . . . . 101 Introducing LINQ to SQL 101 Building the Data Access Layer Using LINQ to SQL 104 Introducing Windows Workflow Foundation 112 Building the Business Layer Using WF 113 Implementing the DashboardFacade 127 Summary 133 5. Building Client-Side Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Delaying Server-Side Widget Loading 135 Content Proxy 138 Building a Client-Side RSS Widget 142 Building a Client-Side Flickr Widget 146 Summary 151 6. Optimizing ASP.NET AJAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 Combining Multiple Ajax Calls into One Call 152 Timing and Ordering Ajax Calls to the Server 154 Using HTTP GET Calls Instead of HTTP POST 165 Working with the this Function 166 Summary 168 7. Creating Asynchronous, Transactional, Cache-Friendly Web Services . . . . 169 Scalability Challenges with Web Services 169 Asynchronous Web Methods 171 Modifying the ASP.NET AJAX Framework to Handle Web Service Calls 175 Developing Your Own Web Service Handler 177 Making an Asynchronous and Cache-Friendly Proxy 189 Scaling and Securing the Content Proxy 191 Summary 196 viii | Table of Contents
Description: