Designing Microsoft ASP.NET Applications by Douglas J
Total Page:16
File Type:pdf, Size:1020Kb
Designing Microsoft ASP.NET Applications by Douglas J. Reilly ISBN: 0735613486 Microsoft Press © 2002 (402 pages) Move beyond simple ASP scripting --and learn how to build sophisticated Web applicatons with ASP.NET. Companion Web Site Table of Contents Designing Microsoft ASP.NET Applications Acknowledgments Introduction Chapter 1 - Introduction to ASP.NET Development Chapter 2 - Managed Code and the Common Language Runtime Chapter 3 - The .NET Framework Objects and Languages Chapter 4 - ASP.NET Development 101 Chapter 5 - Web Forms Chapter 6 - Creating ASP.NET Components Chapter 7 - Balancing Server and Client Functionality Chapter 8 - Time to Get the Data Chapter 9 - Data and ASP.NET Forms Chapter 10 - XML Web Services Appendix A - Configuring ASP.NET Applications in IIS Appendix B - What You Need to Know About HTML to Use This Book Index List of Figures List of Tables List of Listings List of Sidebars Designing Microsoft ASP.NET Applications Douglas J. Reilly PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2002 by Douglas J. Reilly All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Library of Congress Cataloging-in-Publication Data Reilly, Douglas J. Designing Microsoft ASP.NET Applications / Douglas J. Reilly. p. cm. Includes index. ISBN 0-7356-1348-6 1. Internet programming. 2. Active server pages. 3. Web servers. I. Title. QA76.625 .R45 2001 005.2’76—dc21 2001051310 Printed and bound in the United States of America. 1 2 3 4 5 6 7 8 9 QWE 6 5 4 3 2 1 Distributed in Canada by Penguin Books Canada Limited. A CIP catalogue record for this book is available from the British Library. Microsoft Press books are available through booksellers and distributors worldwide. For further information about international editions, contact your local Microsoft Corporation office or contact Microsoft Press International directly at fax (425) 706-7329. Visit our Web site at www.microsoft.com/mspress. Send comments to [email protected]. ActiveX, JScript, Microsoft, Microsoft Press, MS-DOS, Visual Basic, Visual C++, Visual Studio, Windows, and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Other product and company names mentioned herein may be the trademarks of their respective owners. The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Acquisitions Editor David Clark Project Editor Sally Stickney Manuscript Editor Jennifer Harris Body Part No. X08-06257 For Jean, Tim, and Erin– I owe my life to the people I love. The manuscript for this book was prepared and galleyed using Microsoft Word 2002. Pages were composed by Microsoft Press using Adobe PageMaker 6.52 for Windows, with text in Garamond and display type in Helvetica Condensed. Composed pages were delivered to the printer as electronic prepress files. Cover Designer Methodologie, Inc. Interior Graphic Designer James D. Kramer Principal Compositor Carl Diltz Interior Artist Joel Panchot Principal Copy Editor Cheryl Penner Indexer Shane-Armstrong Information Systems About the Author Ever since he convinced his wife to spend what seemed like far too much money on an Atari 800, Douglas J. Reilly has loved to play with computers. For many years before that, he made a living repairing photocopiers and early personal computers. But after a while, the software seemed to be more fun than the hardware. Doug is the owner of Access Microsystems Inc., a small consulting firm that develops software using Microsoft Visual C++, Borland Delphi, Microsoft Access, and the Microsoft .NET Framework. He has created applications to electronically test job applicants, track retailer’s inventory, and repair damaged databases. Currently he is working on a variety of healthcare applications for the St. Barnabas Health Care System as well as applications for the golf and leisure industry for Golf Society of the U.S., both in New Jersey. In addition to developing software, Doug has published articles in Dr. Dobb’s Journal and Software Development, and he wrote a column in the Pervasive Software Developer’s Journal. He has also published another book with Microsoft Press, Inside Server-Based Applications (2000). Doug lives with his wife, Jean, and their two children, Tim and Erin. When not programming, he enjoys music, reading, and bicycle riding, although book writing and other concerns have conspired against serious riding this year. Maybe next year. Doug can be reached by e-mail at [email protected]. Acknowledgments I’m one of a relatively small group of people: long-term survivors of liver cancer. As I was writing my last book, I was diagnosed with and treated for liver cancer. That I am here to write about it almost four years later is a testament to good fortune, good technology, and good people. First among the good people who got me this far is Dr. Hans Gerdes at Memorial Sloan Kettering Cancer Center, who, along with his office assistant, Joanne Booth-Pezantez, didn’t take “We don’t know what that spot on Doug’s liver is” for an answer. Dr. Gerdes is more than a doctor; he has become someone I trust for advice and support for all the chaos caused by Familial Adenomatous Polyposis, the disease at the root of my family’s health problems. For more information on this and other hereditary colon cancers, see http://www.hereditarycc.org. I must mention the “Freds” (Fred Stodolak and Fred Paliani), Jim Hoffman, Rich Iavarone, Tara O’Neill, and Jason Nadal at Golf Society of the U.S. The Freds provided a work environment that allowed me to use neat technology while not requiring me to dress up. They also kindly allowed me to use a couple of the articles from the Golf Society of the U.S. Web site (http://www.golfsociety.com) for an example in Chapter 10. Jim was the best boss a guy could have, especially a guy like me who likes to hole up in the basement and play with computers. Jim has looked at some of the chapters, and his honest assessment of what makes sense and what doesn’t has helped me a great deal. Rich and Jason have given me a hand on occasion with JavaScript questions. Tara worked some magic on my picture for use in the author bio page. Trust me, she didn’t have much to work with! Thanks, all. In my spare time, I do a great deal of work for the St. Barnabas Healthcare System (SBHCS). Kathy Collins and Rich Wheatley have allowed me to continue working on cool projects in the four years or so since I left full-time employment there. SBHCS has provided a wonderful environment for creating cool systems that work on one of the largest intranets in the state. In addition to Rich and Kathy, I also work closely with Darcy Kindred (an interface goddess), Ryan Grim, and Joanne Gibson, among others. Thanks for your patience while I was writing this book. A special thanks to the folks in the SBHCS Behavioral Health Call Center, who have put up with delays in making changes to their system due to my too busy schedule during the writing of this book. Susan Warren at Microsoft was an amazing help, answering more than one frazzled e- mail when I was late delivering a chapter and the examples just wouldn’t work. Her patience in pointing out my mistakes and her willingness to dig in to get to the bottom of things when there was a real problem helped immensely. Susan, along with Scott Guthrie and Rob Howard, also provided great support for me and all the ASP.NET authors, starting what seems like a lifetime ago, back at the first ASP.NET author’s summit. At that first ASP.NET author’s summit, I happened to get teamed up with G. Andrew Duthie of Graymad Enterprises for a hands-on exercise. Since then, we have corresponded and commiserated through e-mail and in person at various conferences. Andrew’s book on ASP.NET should be finished “real soon now,” and I encourage you to take a look at it when it hits the shelves. Andrew is perhaps the most outspoken proponent of Microsoft technology that I know, and he uses that technology to do some neat things. Others who I trust for technical feedback and just plain advice include Ed Colosi, Tom Dignan, Michael Zaccardi, and Sue Shaw. Claudette Moore, my agent, worked harder on this book than she might on some others. Thank you for getting in there and helping me organize my thoughts. Writing a book for Microsoft Press is different than most other book-writing experiences. But writing this book was different than even the normal Microsoft Press experience. This is not exactly the book I had initially planned, due in part to the huge success of ASP.NET, even in beta. Because of this unexpected success, it was important to get the book out there, even if that meant some last-minute changes. My editor, Sally Stickney; Jennifer Harris, the manuscript editor; David Clark, the acquisitions editor; and Robert Lyon, the technical editor, have all been amazing even in the face of seemingly unreasonable deadlines, the normal beta software weirdness, and my constantly remembering one more great thing I needed to add. Robert especially has saved me from myself on more than one occasion.