Zabir - Building a Web 2.0 Portal with ASP.NET 3.5 (O'Reilly, 2008).pdf

(3933 KB) Pobierz
436126948 UNPDF
Building a Web 2.0 Portal
with ASP.NET 3.5
Omar AL Zabir
Beijing Cambridge Farnham Köln Paris Sebastopol Taipei Tokyo
436126948.003.png
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 or corporate@oreilly.com .
Editor: John Osborn
Production Editor: Laurel R.T. Ruma
Copyeditor: Laurel R.T. Ruma
Proofreader: Mary Brady
Indexer: John Bickelhaupt
Cover Designer: Karen Montgomery
Interior Designer: David Futato
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 .NET logo, Visual Basic, Visual C++, Visual Studio, and Windows are registered
trademarks of Microsoft Corporation.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
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.
While every precaution has been taken in the preparation of this book, the publisher and author assume
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]
436126948.004.png
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
436126948.005.png 436126948.006.png
 
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
436126948.001.png
8. Improving Server-Side Performance and Scalability
. . . . . . . . . . . . . . . . . . .
197
Instrumenting Your Code to Identify Performance Problems
198
Optimizing the HTTP Pipeline
199
Optimizing ASP.NET 2.0/3.5 Before Going Live
200
Optimizing Queries in the ASP.NET Membership Tables
201
Optimizing the ASP.NET 2.0/3.5 Profile Provider Before You Go Live
203
ASP.NET Production Challenges
219
Redirecting Traffic from an Old Web Site to a New One
221
Summary
223
9. Improving Client-Side Performance
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
224
Understanding Web Caching
224
Content Delivery Networks
234
Optimizing Internet Explorer JavaScript Performance
238
Reducing the Web Service Call Payload
246
Loading the UI on Demand
247
Using Read-Ahead Caching for Ajax Calls
250
Hiding HTML Inside <textarea>
250
Summary
253
10. Solving Common Deployment, Hosting, and Production Challenges
. . . . .
254
Deploying Your Web Site in a Web Farm
254
Thirteen Production Disasters That Could Happen at Anytime
260
Choosing the Right Hosting Provider
272
Choosing a Web Site Monitoring Tool
274
Configuring Proper Performance Counters
276
Summary
282
Index
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
283
Table of Contents
|
ix
436126948.002.png
Zgłoś jeśli naruszono regulamin