beginning asp.net 3.5

770 166 0
beginning asp.net 3.5

Đ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

Updates, source code, and Wrox technical support at www.wrox.com Beginning ASP.NET 3.5 In C# and VB Imar Spaanjaars spine=1.536" www.wrox.com $44.99 USA $48.99 CAN Wrox Beginning guides are crafted to make learning programming languages and technologies easier than you think, providing a structured, tutorial format that will guide you through all the techniques involved. Recommended Computer Book Categories Web Development ASP.NET ISBN: 978-0-470-18759-3 To build effective and eye-catching database-driven web sites, you must first have a solid framework on which to run your web pages as well as a rich environment in order to create and program these web pages. Microsoft’s ASP.NET 3.5 and Visual Web Developer™ 2008 combine forces to provide you with the ultimate platform on which you can create dynamic and interactive web applications. Popular Wrox author Imar Spaanjaars begins by demonstrating how to obtain and install Visual Web Developer. With each successive chapter, he introduces you to new technologies that build on knowledge gained from previous chapters. You’ll learn that both ASP.NET 3.5 and Visual Web Developer now come with an extensive set of tools that will help you smoothly program your web applications. With the knowledge you gain from this book, you will be able to create feature-rich, database-driven, interactive web sites. What you will learn from this book ● Ways that ASP.NET Server controls allow you to create complex web sites with very little code ● How to use the extensive set of CSS tools that help you design your web pages ● How to program responsive and interactive web pages with either C# or Visual Basic® ● How to work with databases to create rich, data-driven web pages ● How you can easily create a centralized and maintainable site design ● How to secure your web site, providing login functionality and role-based access to content Who this book is for This book is for anyone who wants to build rich and interactive web sites that run on the Microsoft platform. No prior experience in web development is assumed. Enhance Your Knowledge Advance Your Career Beginning ASP.NET 3.5 In C# and VB Spaanjaars Beginning ASP.NET 3.5 In C# and VB Wrox Programmer to Programmer TM Wrox Programmer to Programmer TM www.it-ebooks.info 87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page ii www.it-ebooks.info Beginning ASP.NET 3.5 Chapter 1: Getting Started with ASP.NET 3.5 . . . . . . . . . . . . . . . . . . . . . . . . . 1 Chapter 2: Building an ASP.NET Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Chapter 3: Designing Your Web Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Chapter 4: Working with ASP.NET Controls . . . . . . . . . . . . . . . . . . . . . . . . . 103 Chapter 5: Programming Your ASP.NET Web Pages . . . . . . . . . . . . . . . . . . . 135 Chapter 6: Creating Consistent Looking Web Sites . . . . . . . . . . . . . . . . . . . 193 Chapter 7: Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 Chapter 8: User Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 Chapter 9: Validating User Input. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 Chapter 10: ASP.NET AJAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 Chapter 11: Introduction to Databases. . . . . . . . . . . . . . . . . . . . . . . . . . . . 353 Chapter 12: Displaying and Updating Data . . . . . . . . . . . . . . . . . . . . . . . . . 383 Chapter 13: LINQ. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425 Chapter 14: Presenting Data — Advanced Topics . . . . . . . . . . . . . . . . . . . . 475 Chapter 15: Security in Your ASP.NET 3.5 Web Site . . . . . . . . . . . . . . . . . . 517 Chapter 16: Personalizing Web Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557 Chapter 17: Exception Handling, Debugging, and Tracing . . . . . . . . . . . . . . 591 Chapter 18: Deploying Your Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631 Appendix A: Exercise Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665 Appendix B: Configuring SQL Server 2005 . . . . . . . . . . . . . . . . . . . . . . . . . 687 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707 87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page i www.it-ebooks.info 87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page ii www.it-ebooks.info Beginning ASP.NET 3.5 In C# and VB Imar Spaanjaars 87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page iii www.it-ebooks.info Beginning ASP.NET 3.5: In C# and VB Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-0-470-18759-3 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 Library of Congress Cataloging-in-Publication Data Spaanjaars, Imar. Beginning ASP.NET 3.5 / Imar Spaanjaars. p. cm. Includes index. ISBN 978-0-470-18759-3 (pbk. : web) 1. Active server pages. 2. Web sites—Design. 3. Microsoft .NET. I. Title. TK5105.8885.A26S6815 2006 005.2'76—dc22 2007052406 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional serv- ices. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the pub- lisher endorses the information the organization or Website may provide or recommendations it may make. Further, readers should be aware that Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other coun- tries, and may not be used without written permission. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be avail- able in electronic books. 87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page iv www.it-ebooks.info To my dad — I know you’d be proud 87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page v www.it-ebooks.info 87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page vi www.it-ebooks.info About the Author Imar Spaanjaars graduated in Leisure Management at the Leisure Management School in the Netherlands, but he quickly changed his career path into the Internet world. After working for a large corporation and doing some freelance work, he now works for Design IT ( www.designit.nl), an IT company in the Netherlands specializing in Internet and intranet applica- tions built with Microsoft technologies like ASP.NET 3.5. As a technical director and software designer, he’s responsible for designing and building medium- to large-scaled e-commerce web sites and portals. He’s also the tech lead for Dynamicweb Nederland, the Dutch branch of the popular Danish Content Management System Dynamicweb ( www.dynamicweb.nl). Imar has written books on ASP.NET 2.0 and Macromedia Dreamweaver, all published under the Wrox brand. He is also one of the top contributors to the Wrox Community Forum at p2p.wrox.com, where he shares his knowledge with fellow programmers. Imar lives in Utrecht, the Netherlands, with his girlfriend, Fleur. You can contact him through his personal web site at http://imar.spaanjaars.com. 87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page vii www.it-ebooks.info 87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page viii www.it-ebooks.info [...]... program these web pages With ASP.NET 3.5 and Visual Web Developer 2008 you get both Together they form the platform to create dynamic and interactive web applications ASP.NET 3.5 builds on top of its popular predecessor ASP.NET 2.0 While maintaining backward compatibility with sites built using this older version, the Microsoft NET Framework 3.5 in general and ASP.NET 3.5 in particular add a lot of... Page xiii Contents Acknowledgments Introduction xi xxiii Chapter 1: Getting Started with ASP.NET 3.5 Microsoft Visual Web Developer Getting Visual Web Developer Installing Visual Web Developer Express Edition Creating Your First ASP.NET 3.5 Web Site An Introduction to ASP.NET 3.5 Understanding HTML A First Look at ASP.NET Markup A Tour of the IDE 1 2 3 3 5 9 10 14 15 The Main Development Area Informational... with previous versions of ASP.NET, with the 1.x versions in particular, you may gain a lot from this book Although many concepts from ASP.NET 2.0 are brought forward into ASP.NET 3.5, you’ll discover there’s a host of new stuff to be found in this book, including an introduction to LINQ, the new CSS and JavaScript debugging tools, new ASP.NET controls, and integrated support for ASP.NET Ajax What This... the hood, ASP.NET 3.5 makes use of the same run time as version 2.0 This ensures a great backward compatibility with that version, which means that ASP.NET 2.0 applications continue to run under the new framework But don’t be fooled by the fact that the run time hasn’t changed Although the technical underpinnings needed to execute your web application haven’t changed, the NET 3.5 Framework and ASP.NET. .. increasing the productivity The current version, ASP.NET 3.5, builds on top of the successful ASP.NET 2.0 release, leaving many of the beloved features in place, while adding new features and tools in other areas Over the next 18 chapters, you learn how to build full-featured ASP.NET web sites using Visual Web Developer, Microsoft’s development tool for ASP.NET web applications This book guides you through... the path of “less code” that was entered with the 2.0 version of the NET Framework, ASP.NET 3.5 lets you accomplish more with even less code New features like LINQ that are added to the NET Framework allow you to access a database with little to no handwritten code The integration of Microsoft ASP.NET Ajax into the ASP.NET Framework and Visual Web Developer means you can now create fast-responding... is defined by the input of your users This chapter shows you how to accept, validate, and process user input using ASP.NET Server Controls Additionally, you see how to send e-mail from your ASP.NET web application and how to read from text files ❑ Chapter 10, ASP.NET Ajax.” Microsoft ASP.NET Ajax allows you to create good-looking, flickerfree web pages that close the gap between traditional desktop... 9:05 AM Page 2 Chapter 1: Getting Started with ASP.NET 3.5 In November 2005, Visual Studio 2005 and ASP.NET 2.0 were released To the pleasant surprise of many developers around the world, Microsoft had again been able to drastically improve and expand the product, adding many features and tools that helped reduce the complexity that was introduced with ASP.NET 1.0 New wizards and smart controls made... Pitfalls with Caching Data Different Ways to Cache Data in ASP.NET Web Applications Practical Data Tips Summary Exercises 503 505 513 514 515 Chapter 15: Security in Your ASP.NET 3.5 Web Site Introducing Security 517 518 Identity: Who Are You? Authentication: How Can You Prove Who You Are? Authorization: What Are You Allowed to Do? An Introduction to the ASP.NET Application Services Introducing the Login Controls... chapter, you see how to make good use of these tools Additionally, you learn about CSS, the language that is used to format web pages ❑ Chapter 4, “Working with ASP.NET Controls.” ASP.NET Server Controls are one of the most important concepts in ASP.NET They allow you to create complex and feature-rich web sites with very little code This chapter introduces you to the large number of server controls that . Sites 33 7 What Are Web Services? 33 7 Creating Web Services 33 8 Using Web Services in Your Ajax Web Site 34 2 This Is Just the Beginning 34 9 Practical Ajax Tips 34 9 Summary 35 0 Exercises 35 1 Chapter. Databases 35 3 What Is a Database? 35 4 Different Kinds of Relational Databases 35 5 Using SQL to Work with Database Data 35 5 Retrieving and Manipulating Data 35 8 Creating Your Own Tables 37 1 Data. Opening a New Web Site 36 Working with Files in Your Web Site 39 The Many File Types of an ASP. NET 3. 5 Web Site 39 Adding Existing Files 43 8 759 3ftoc.qxd:WroxPro 1/ 25/ 08 11 :31 AM Page xiii www.it-ebooks.info xiv Contents Organizing

Ngày đăng: 01/08/2014, 17:35

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

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

Tài liệu liên quan