ebook img

Beginning ASP.NET in VB .NET: From Novice to Professional PDF

983 Pages·2004·31.147 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Beginning ASP.NET in VB .NET: From Novice to Professional

Beginning ASP.NET in VB .NET: From Novice to Professional MATTHEW MACDONALD APress Media, LLC Beginning ASP.NET in VB .NET: From Novice to Professional Copyright ©2004 by Matthew MacDonald Originally published by Apress in 2004 Ali rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN 978-1-59059-278-6 ISBN 978-1-4302-0710-8 (eBook) DOI 10.1007/978-1-4302-0710-8 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Technical Reviewer: Tim Verycruysse Editorial Board: Dan Appleman, Craig Berry, Gary Cornell, Tony Davis, Steven Rycroft, Julian Skinner, Martin Streicher, Jim Sumser, Karen Watterson, Gavin Wray, John Zukowski Assistant Publisher: Grace Wong Project Manager: Tracy Brown Collins Copy Editor: Mark Nigara Production Manager: Karl Brooks Senior Production Editor: Kelly Wmquist Proofreader: Lori Bring Compositor: Susan Glinert Indexer: John Collin Artist: Christine Calderwood, Kinetic Publishing Services, LLC Cover Designer: Kurt Krames Manufacturing Manager: Tom Debolski The information in this book is distributed on an "as is" hasis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. For my loving wife Faria Contents at a Glance About the Author .................................................................................................. xv Acknowledgments ................................................................................................. xvii Introduction .......................................................................................................... xix Part One ASP. NET Introduction ....................................... 1 Chapter 1 The .NET Framework ................................................................. 3 Chapter 2 Setting Up Internet Information Services and ASP.NET .............................................................................. 19 Chapter 3 Learning the Visual Basic • NET Language ................. 43 Chapter 4 Types, Objects, and Namespaces .................................... 73 Part Two Developing ASP. NET Applications .............. 97 Chapter 5 ASP. NET Applications .......................................................... 99 Chapter 6 Web Form Fundamentals ...................................................... 133 Chapter 7 Web Controls .......................................................................... 165 Chapter 8 Using Visual Studio • NET ............................................... 201 Chapter 9 Validation and Rich Controls ....................................... 233 Chapter 10 State Management ................................................................. 273 Chapter 11 Tracing, Logging, and Error Handling ..................... 305 Chapter 12 Deploying ASP. NET ............................................................... 347 Part Three Working with Data .......................................... 363 Chapter 13 Introducing ADO.NET .......................................................... 365 Chapter 14 ADO. NET Data Access .......................................................... 387 Chapter 15 Data Binding .......................................................................... 431 Chapter 16 The DataList, DataGrid, and Repeater ..................... 457 Chapter 17 Files, Streams, and E-mail ........................................... 501 Chapter 18 Using XML ................................................................................ 529 v Contents at a Glance Part Four Web Services ...................................................... 569 Chapter 19 Web Services Architecture ............................................ 571 Chapter 20 Creating Web Services ..................................................... 587 Chapter 21 Using Web Services ............................................................ 615 Part Five Advanced ASP. NET ................................................. 643 Chapter 22 Component-Based Programming ........................................ 645 Chapter 23 Custom Controls .................................................................. 679 Chapter 24 Caching and Performance Tuning .................................. 725 Chapter 25 Implementing Security ..................................................... 759 Chapter 26 The IBuySpy Case Studies............................................... 797 Part Six ASP. NET Reference .......................................... 837 Chapter 27 HTML Server Controls ....................................................... 839 Chapter 28 Web Controls ......................................................................... 857 Chapter 29 Configuration Files .......................................................... 909 Index ....................................................................................................................... 935 vi Contents About the Author ............................................................................................ xv Acknowledgments ........................................................................................... xvii Introduction ..................................................................................................... xix Part One ASP. NET Introduction ........................................... 1 Chapter The •N ET Framework ......................................................... 1 3 The Evolution of Web Development ................................................................. 3 The .NET Framework ................................................................................................ 9 VB • NET, C#, and the • NET Languages ........................................................ 12 The Common Language Runtime .......................................................................... 14 The • NET Class Library ..................................................................................... ·15 Visual Studio .NET. ............................................................................................. 16 The Last Word ........................................................................................................ 17 Chapter 2 Setting Up Internet Information Services and ASP. NET ......................................................................... 19 Web Servers and You ........................................................................................... 19 Managing Websites ................................................................................................ 24 Installing ASP. NET. ............................................................................................. 37 The Last Word ........................................................................................................ 42 Chapter 3 Learning the Visual Basic • NET Language .................................................................... 43 The .NET Languages .............................................................................................. 43 The Evolution of VB • NET ................................................................................ 44 Variables and Data Types ................................................................................ 46 Variable Operations ........................................................................................... 52 Object-Based Manipulation .............................................................................. 56 Conditional Structures ..................................................................................... 62 Loop Structures .................................................................................................... 64 vii Contents Functions and Subroutines .............................................................................. 67 The Last Word ........................................................................................................ 71 Chapter 4 Types} Objects} and Namespaces ........................ 73 The Basics About Classes ................................................................................ 73 Building a Basic Class.................................................................................... 76 Value Types and Reference Types ................................................................ 85 Advanced Class Programming ........................................................................... 89 Understanding Name spaces and Assemblies ............................................... 92 The Last Word ........................................................................................................ 96 Part Two Developing ASP. NET Applications .............. 97 Chapter 5 ASP. NET Applications ................................................. 99 The Anatomy of an ASP. NET Application ................................................... 99 ASP.NET File Types ........................................................................................... 100 A Simple Application from Start to Finish ......................................... 104 Code-Behind .......................................................................................................... 110 The Global. as ax Application File ............................................................ 120 Understanding the ASP. NET Classes.......................................................... 123 ASP. NET Configuration.................................................................................... 125 The Last Word ...................................................................................................... 132 Chapter 6 Web Form Fundamentals............................................. 133 A Simple Page Applet ...................................................................................... 133 Improving the Currency Converter ............................................................ 144 A Deeper Look at HTML Control Classes ................................................. 150 The Page Class .................................................................................................... 156 The Last Word ...................................................................................................... 163 Chapter 7 Web Controls .................................................................... 165 Stepping Up to Web Controls ....................................................................... 165 Web Control Classes ......................................................................................... 169 List Controls ...................................................................................................... 174 Table Controls .................................................................................................... 177 AutoPostBack and Web Control Events ...................................................... 183 A Simple Web Page Applet .............................................................................. 190 The Last Word ...................................................................................................... 199 viii Contents Chapter 8 Using Visual Studio . NET ...................................... 201 The Promise of Visual Studio . NET ........................................................... 201 Starting a Visual Studio .NET Project .................................................. 202 Designing Web Pages ......................................................................................... 213 Writing Code ......................................................................................................... 217 Visual Studio .NET Debugging ...................................................................... 225 The Last Word ...................................................................................................... 232 Chapter 9 Validation and Rich Controls ............................ 233 The Calendar Control ....................................................................................... 233 The AdRotator ...................................................................................................... 239 Validation ............................................................................................................. 242 A Simple Validation Example ........................................................................ 246 Understanding Regular Expressions ........................................................... 252 Other Rich Controls ......................................................................................... 261 The Microsoft Internet Explorer Controls ............................................ 262 The Last Word ...................................................................................................... 272 Chapter 10 State Management ........................................................... 273 The Problem of State ....................................................................................... 273 View State ............................................................................................................. 274 Transferring Information .............................................................................. 281 Custom Cookies .................................................................................................... 285 Session State ...................................................................................................... 288 Session State Configuration ........................................................................ 294 Application State .............................................................................................. 300 An Overview of State Management Choices .............................................. 302 The Last Word ...................................................................................................... 303 Chapter 11 Tracing, Logging, and Error Handling ....... 305 Common Errors ...................................................................................................... 305 The .NET Exception Object ............................................................................ 308 Handling Exceptions ......................................................................................... 310 Throwing Your OWn Exceptions ...................................................................... 316 Logging Exceptions ............................................................................................ 319 Error Pages ........................................................................................................... 328 Page Tracing ......................................................................................................... 333 The Last Word ...................................................................................................... 345 ix Contents Chapter 12 Deploying ASP. NET ....................................................... 347 Making Your Website Visible ....................................................................... 347 Deploying a Simple Site ................................................................................ 348 Deploying with Visual Studio .NET .......................................................... 352 Migrating from ASP ........................................................................................... 360 The Last Word ...................................................................................................... 362 Part Three Working with Data ................................................ 363 Chapter 13 Introducing ADO.NET .................................................. 365 Introducing ADO.NET and Data Management ............................................. 365 The ADO.NET Object Model .............................................................................. 373 Comparing ADO and ADO.NET. ........................................................................... 383 The Last Word ...................................................................................................... 385 Chapter 14 ADO.NET Data Access .................................................. 387 About the ADO.NET Examples ......................................................................... 387 SQL Basics ............................................................................................................ 388 The Select Statement ...................................................................................... 390 The SQL Update Statement .............................................................................. 393 The SQL Insert Statement .............................................................................. 394 The SQL Delete Statement .............................................................................. 396 Accessing Data the Easy Way ....................................................................... 396 Creating a Connection .................................................................................... 397 Defining a Select Command ............................................................................ 401 Updating Data ...................................................................................................... 407 Using Disconnected Data ................................................................................ 414 Updating Disconnected Data ......................................................................... 422 The Last Word ...................................................................................................... 430 Chapter 15 Data Binding .................................................................... 431 Introducing Data Binding .............................................................................. 431 Single-Value Data Binding ............................................................................ 433 Repeated-Value Data Binding ....................................................................... 440 Data Binding with Databases ....................................................................... 448 The Last Word ...................................................................................................... 455 X

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.