Manning.Publications.ASP.Net.2.0.Web.Parts.in.Action.Building.Dynamic.Web.Portals.Oct.2006

345 444 0
Manning.Publications.ASP.Net.2.0.Web.Parts.in.Action.Building.Dynamic.Web.Portals.Oct.2006

Đ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

Manning.Publications.ASP.Net.2.0.Web.Parts.in.Action.Building.Dynamic.Web.Portals.Oct.2006

ASP.NET 2.0 Web Parts in Action ASP.NET 2.0 Web Parts in Action Building Dynamic Web Portals DARREN NEIMKE MANNING Greenwich (74° w long.) For online information and ordering of this and other Manning books, please go to www.manning.com The publisher offers discounts on this book when ordered in quantity For more information, please contact: Special Sales Department Manning Publications Cherokee Station PO Box 20386 New York, NY 10021 Fax: (609) 877-8256 email: orders@manning.com ©2007 by Manning Publications Co All rights reserved No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end Manning Publications Co Cherokee Station PO Box 20386 New York, NY 10021 Copyeditor: Sharon Mullins Typesetter: Gordan Salinovic Cover designer: Leslie Haimes ISBN 1-932394-77-X Printed in the United States of America 10 – VHG – 10 09 08 07 06 To Bill Wilkinson, for teaching me to program brief contents Part Portals and web parts 1 Introducing portals and web parts Web parts: the building blocks of portals Using web part connections The Web Part Manager 32 65 96 Working with zones 127 Understanding personalization 158 Part Extending the portal framework 199 Creating an enhanced editing experience 201 Useful portal customizations 229 Portal management 257 10 Into the future 282 appendix Creating the Adventure Works project 310 vii contents foreword xiii preface xiv acknowledgments xv about this book xvi about the title xix about the cover illustration xx Part Portals and web parts 1 Introducing portals and web parts 1.1 Introduction 1.2 What is a portal? Anatomy of a portal ✦ A portal example 1.3 Using the ASP.NET 2.0 portal framework 16 Components of the framework 16 1.4 Introducing Adventure Works Cycles database 18 What is the database? 18 ✦ You’re hired! 19 Getting our hands on data 21 1.5 Summary 31 Web parts: the building blocks of portals 32 2.1 Introduction 32 2.2 Exploring web parts 33 Discovering the GenericWebPart control 34 2.3 Understanding the WebPart class 38 Using custom controls 38 ✦ Creating web parts with user controls 2.4 Understanding web part internals 45 IWebPart 46 ✦ IWebActionable 48 ✦ IWebEditable 52 ix 42 A P P E N D I X Creating the Adventure Works project A.1 INTRODUCTION This walkthrough shows how to create an ASP.NET web project in Visual Studio 2005 This web project forms the basis for building the web portal that is referred to throughout the book The tasks that are illustrated in this walkthrough include • • • • • Creating a new web project Referencing an Assembly which contains data access logic Configuring the application Implementing a Master Page Creating a Theme NOTE A.2 All the files for the completed version of this project can be found in the chapter section of the resources website at www.manning.com/neimke Feel free to copy the source files from there to save yourself some typing STARTING THE PROJECT Open Visual Studio 2005 and create a C# web project named AdventureWorksWeb and save it to a convenient location in your filesystem such as C:\Sandboxes\AdventureWorks Once the project has been created, add a reference to the AW.WebParts.Data assembly that we created in chapter To this, right-click on the 310 project folder and choose Add Reference; this will launch the Add Reference dialog as shown in figure A.1 NOTE If you didn’t complete chapter 1, you can find the AW.Portal.Data assembly in the chapter section of the resources website for this book Browse to the location of the AW.Portal.Data assembly file and add it as a reference With the data layer now referenced by the web application, we are able to use the methods we created in that assembly to perform all our data access operations Recall that the data layer requires a connection string to be defined in the web configuration file, so our next step is to add a Web.config file to store this configuration entry To add a Web.config file to the project, right-click on the project element in the Solution Explorer and choose the Add New Item menu option After adding a Web.config file to our project, we can open it and add the connection string information Make sure that the Web.config file now contains the configu- Figure A.1 The Add Reference dialog ration data shown in listing A.1: window in Visual Studio 2005 Listing A.1 In ASP.NET 2.0, the new connectionStrings element is used to store sensitive connection string information

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

Từ khóa liên quan

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

Tài liệu liên quan