Tải bản đầy đủ (.pdf) (770 trang)

beginning asp.net 3.5

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (41.76 MB, 770 trang )

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 />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
.
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
Credits
Acquisitions Director
Jim Minatel
Development Editor
Brian Herrmann
Lead Technical Editor
Peter Lanoie
Technical Editors
Alexei Gorkov
John Dunagan
Robert Searing
Editorial Manager

Mary Beth Wakefield
Production Manager
Tim Tate
Vice President and Executive Group Publisher
Richard Swadley
Vice President and Executive Publisher
Joseph B. Wikert
Project Coordinator, Cover
Lynsey Stanford
Compositor
Laurie Stewart, Happenstance Type-O-Rama
Proofreaders
Kathryn Duggan
David Parise
Rachel Gunn
Indexer
Melanie Belkin
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page ix
www.it-ebooks.info
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page x
www.it-ebooks.info
Acknowledgments
Writing a book is probably one of the most exhausting but fun and rewarding things I have ever done.
During writing you have to invest a lot of time and effort to put your ideas down into something that
is worth reading by others. After the hard work is done and the book is written, the reward comes from
readers like you who send me e-mails, contact me through my web site, or participate in the online dis-
cussion forums at
p2p.wrox.com to discuss the book.
As Norman Mailer put it, writing a book is the closest that men ever get to childbearing. Although I think
there is probably some truth in that statement, I also realize there is one big difference: writing a book is

not something you have to do on your own. Although only my name is on the cover, I owe a lot to many
people who helped me write this book.
First of all I’d like to thank Jim Minatel from Wiley for asking me to pick up this project and having faith
in my ability to bring it to a good end. I would also like to thank Brian Herrmann for his editorial work. I
know it wasn’t always easy with the number of reviewers we had, but I think it turned out pretty well.
I am very thankful for the work done by the technical editors on this book: Alexei, John, and Rob —
thanks, guys, for all your hard work! I particularly want to thank the lead technical editor, Peter Lanoie,
who has made a major contribution, both in shaping the direction of the book and in assuring its technical
accuracy. Thank you, Peter!
I am also very glad for the support I got from the people at Design IT. Thanks to all who have reviewed
my work and participated in my discussions on the book’s direction.
Another person I owe a lot to is Anne Ward from Blue Violet, a UK-based web and graphic design com-
pany. Anne has done most of the designs used in this book, which I highly appreciate. Thanks, Anne!
The concert pictures you see in this book come from her good friend Nigel D. Nudds, who kindly let me
use pictures from his collection.
Finally, I would like to thank my lovely girlfriend, Fleur. You may get tired of hearing it, but I really
appreciate the support you have given me throughout this project. I couldn’t — and wouldn’t — have
done it without you!
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page xi
www.it-ebooks.info
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page xii
www.it-ebooks.info
Contents
Acknowledgments xi
Introduction xxiii
Chapter 1: Getting Started with ASP.NET 3.5 1
Microsoft Visual Web Developer 2
Getting Visual Web Developer 3
Installing Visual Web Developer Express Edition 3
Creating Your First ASP.NET 3.5 Web Site 5

An Introduction to ASP.NET 3.5 9
Understanding HTML 10
A First Look at ASP.NET Markup 14
A Tour of the IDE 15
The Main Development Area 15
Informational Windows 21
Customizing the IDE 22
Rearranging Windows 22
Modifying the Toolbox 23
Customizing the Document Window 25
Customizing Toolbars 25
Customizing Keyboard Shortcuts 26
Resetting Your Changes 27
The Sample Application 28
Practical Tips on Visual Web Developer 30
Summary 30
Exercises 31
Chapter 2: Building an ASP.NET Web Site 33
Creating Web Sites with VWD 2008 34
Different Project Types 34
Choosing the Right Web Site Template 35
Creating and 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
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xiii
www.it-ebooks.info
xiv
Contents
Organizing Your Site 44

Special File Types 46
Working with Web Forms 47
The Different Views on Web Forms 47
Choosing between Code Behind and Pages with Inline Code 48
Adding Markup to Your Page 53
Connecting Pages 59
Practical Tips on Working with Web Forms 61
Summary 61
Exercises 62
Chapter 3: Designing Your Web Pages 63
Why Do You Need CSS? 63
Problems of HTML Formatting 64
How CSS Fixes Formatting Problems 65
An Introduction to CSS 65
CSS — The Language 69
The Style Sheet 69
Adding CSS to Your Pages 80
Working with CSS in Visual Web Developer 82
Creating New Styles in External Style Sheets 83
Creating Embedded and Inline Style Sheets 88
Applying Styles 94
Managing Styles 96
Practical Tips on Working with CSS 99
Summary 100
Exercises 100
Chapter 4: Working with ASP.NET Controls 103
Introduction to Server Controls 103
A Closer Look at ASP.NET Server Controls 107
Defining Controls in Your Pages 108
Common Properties for All Controls 108

Types of Controls 110
Standard Controls 111
HTML Controls 124
Data Controls 124
Validation Controls 125
Navigation Controls 125
Login Controls 125
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xiv
www.it-ebooks.info
xv
Contents
Ajax Extensions 125
WebParts 125
The ASP.NET State Engine 126
What Is State and Why Is It Important? 126
How the State Engine Works 127
Not All Controls Rely on ViewState 131
A Note About ViewState and Performance 131
Practical Tips on Working with Controls 132
Summary 132
Exercises 133
Chapter 5: Programming Your ASP.NET Web Pages 135
Introduction to Programming 136
Data Types and Variables 136
Converting Data Types 140
Using Arrays and Collections 142
Statements 146
Operators 147
Making Decisions 154
Loops 161

Organizing Code 164
Methods: Functions and Subroutines 165
The App_Code Folder 167
Organizing Code with Namespaces 171
Writing Comments 173
Object Orientation Basics 176
Important OO Terminology 176
Events 188
Practical Tips on Programming 189
Summary 190
Exercises 191
Chapter 6: Creating Consistent Looking Web Sites 193
Consistent Page Layout with Master Pages 194
Creating Master Pages 196
Creating Content Pages 198
Using a Centralized Base Page 203
An Introduction to the ASP.NET Page Life Cycle 204
Implementing the Base Page 206
Creating Reusable Page Templates 210
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xv
www.it-ebooks.info
xvi
Contents
Themes 214
Different Types of Themes 215
Choosing Between Theme and StyleSheetTheme 215
Applying Themes 215
Extending Themes 219
Dynamically Switching Themes 222
Skins 228

Creating a Skin File 229
Named Skins 231
A Final Note on Skins 232
Practical Tips on Creating Consistent Pages 232
Summary 233
Exercises 234
Chapter 7: Navigation 235
Different Ways to Move around Your Site 236
Understanding Absolute and Relative URLs 236
Understanding Default Documents 240
Using the Navigation Controls 241
Architecture of the Navigation Controls 242
Examining the Web.sitemap File 242
Using the Menu Control 244
Using the TreeView Control 253
Using the SiteMapPath Control 257
Programmatic Redirection 259
Programmatically Redirecting the Client to a Different Page 259
Server-Side Redirects 261
Practical Tips on Navigation 264
Summary 264
Exercises 265
Chapter 8: User Controls 267
Introduction to User Controls 267
Creating User Controls 268
Adding User Controls to a Content Page or Master Page 271
Site-Wide Registration of User Controls 274
User Control Caveats 275
Adding Logic to Your User Controls 277
Creating Your Own Data Types for Properties 277

87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xvi
www.it-ebooks.info
xvii
Contents
Implementing ViewState Properties 283
ViewState Considerations 288
Practical Tips on User Controls 289
Summary 289
Exercises 290
Chapter 9: Validating User Input 291
Gathering Data from the User 292
Validating User Input in Web Forms 293
Processing Data at the Server 307
Sending E-mail from Your Web Site 307
Reading from Text Files 313
Practical Tips on Validating Data 318
Summary 318
Exercises 319
Chapter 10: ASP.NET AJAX 321
Introducing Ajax 322
Using ASP.NET AJAX in Your Projects 323
Creating Flicker-Free Pages 323
Providing Feedback to Users 328
Using the Timer Control 332
Using Web Services in Ajax Web Sites 337
What Are Web Services? 337
Creating Web Services 338
Using Web Services in Your Ajax Web Site 342
This Is Just the Beginning 349
Practical Ajax Tips 349

Summary 350
Exercises 351
Chapter 11: Introduction to Databases 353
What Is a Database? 354
Different Kinds of Relational Databases 355
Using SQL to Work with Database Data 355
Retrieving and Manipulating Data 358
Creating Your Own Tables 371
Data Types in SQL Server 371
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xvii
www.it-ebooks.info
xviii
Contents
Understanding Primary Keys and Identities 373
Creating Relationships Between Tables 377
Practical Database Tips 380
Summary 381
Exercises 381
Chapter 12: Displaying and Updating Data 383
Data Controls 383
Data-Bound Controls 384
Data Source Controls 386
Data Source and Data-Bound Controls Working Together 386
Displaying and Editing Data with GridView 386
Inserting Data with DetailsView 392
Storing Your Connection Strings in web.config 395
Filtering Data 397
Customizing the Appearance of the Data Controls 403
Configuring Columns or Fields of Data-Bound Controls 403
Updating and Inserting Data 409

Using DetailsView to Insert and Update Data 409
Practical Tips for Displaying and Updating Data 422
Summary 423
Exercises 423
Chapter 13: LINQ 425
Introducing LINQ 426
Different Types of LINQ 427
Introducing LINQ to SQL 427
Mapping Your Data Model to an Object Model 428
Introducing Query Syntax 433
Standard Query Operators 433
Shaping Data with Anonymous Types 437
Using Server Controls with LINQ Queries 443
New Controls Introduced in ASP.NET 3.5 443
A Few Notes about Performance 471
Practical LINQ Tips 472
Summary 472
Exercises 473
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xviii
www.it-ebooks.info
xix
Contents
Chapter 14: Presenting Data — Advanced Topics 475
Formatting Your Controls Using Styles 476
An Introduction to Styles 477
Combining Styles, Themes, and Skins 481
Handling Events 485
The ASP.NET Page and Controls Life Cycles Revisited 485
Handling Errors that Occur in the Data Source Controls 498
Caching 502

Common Pitfalls with Caching Data 503
Different Ways to Cache Data in ASP.NET Web Applications 505
Practical Data Tips 513
Summary 514
Exercises 515
Chapter 15: Security in Your ASP.NET 3.5 Web Site 517
Introducing Security 518
Identity: Who Are You? 518
Authentication: How Can You Prove Who You Are? 518
Authorization: What Are You Allowed to Do? 518
An Introduction to the ASP.NET Application Services 519
Introducing the Login Controls 520
The Login Controls 525
Configuring Your Web Application 537
The Role Manager 541
Configuring the Role Manager 541
Managing Users with the WSAT 542
Configuring the Web Application to Work with Roles 546
Programmatically Checking Roles 551
Practical Security Tips 554
Summary 555
Exercises 555
Chapter 16: Personalizing Web Sites 557
Understanding Profile 558
Configuring the Profile 558
Using the Profile 565
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xix
www.it-ebooks.info
xx
Contents

Other Ways of Dealing with Profile 583
Anonymous Identification 583
Cleaning Up Old Anonymous Profiles 584
Looking at Other Users’ Profiles 585
Practical Personalization Tips 589
Summary 589
Exercises 590
Chapter 17: Exception Handling, Debugging, and Tracing 591
Exception Handling 592
Different Types of Errors 592
Catching and Handling Exceptions 594
Global Error Handling and Custom Error Pages 601
The Basics of Debugging 607
Tools Support for Debugging 611
Moving around in Debugged Code 611
Debugging Windows 612
Debugging Client-Side Script 618
Tracing Your ASP.NET Web Pages 621
Using the Standard Tracing Capabilities 622
Adding Your Own Information to the Trace 626
Tracing and Performance 628
A Security Warning 628
Practical Debugging Tips 628
Summary 629
Exercises 630
Chapter 18: Deploying Your Web Site 631
Preparing Your Web Site for Deployment 632
Avoiding Hardcoded Settings 632
Copying Your Web Site 639
Creating a Simple Copy of Your Web Site 639

Publishing Your Web Site 642
Running Your Site under IIS 643
Installing and Configuring the Web Server 643
Understanding Security in IIS 651
NTFS Settings for Planet Wrox 652
Troubleshooting Web Server Errors 656
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xx
www.it-ebooks.info
xxi
Contents
Moving Data to a Remote Server 657
Using the Database Publishing Wizard 658
Recreating the Database 660
The Deployment Checklist 661
What’s Next 662
Summary 663
Exercises 664
Appendix A: Exercise Answers 665
Appendix B: Configuring SQL Server 2005 687
Configuring SQL Server 2005 687
Terminology and Concepts 688
Using SQL Server Management Studio 689
Enabling Remote Connections in SQL Server 690
Connecting Your Application to SQL Server 2005 693
Configuring Application Services 701
Configuring Your Database for the Application Services 702
Overriding the LocalSqlServer Connection String 703
Overriding the Settings of the Application Services 704
Index 707
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xxi

www.it-ebooks.info
87593flast.qxd:WroxPro 1/28/08 8:56 AM Page xxii
www.it-ebooks.info
Introduction
To build effective and attractive database-driven web sites, you need two things: a solid and fast frame-
work to run your web pages on and a rich and extensive environment to create and 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 compati-
bility 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 new, compelling features to the mix.
Continuing 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 Frame work 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 and spiffy web interfaces simply by dragging a few controls onto your page and
setting a few properties. This book gives you an in-depth look at both of these technologies.
The support for Cascading Style Sheets (CSS), the language to lay out and format web pages, has under-
gone a major overhaul in Visual Web Developer. The design-time support, that shows you how a page
will eventually look in the browser, has been vastly improved. Additionally, Visual Web Developer now
ships with a lot of tools that make writing CSS a breeze.
However, drag-and-drop support and visual tools are not the only things you’ll learn from this book.
ASP.NET 3.5 and Visual Web Developer 2008 come with a great and extensive set of tools to help you
program your web applications. These tools range from the new LINQ syntax that allows you to query
data and databases in your web applications, to the vastly improved debugging capabilities that allow
you to debug your application from client-side JavaScript all the way up into your server-side code, all
with the same familiar user interface, commands, and actions.
Under the hood, ASP.NET 3.5 makes use of the same run time as version 2.0. This ensures a great back-
ward 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 tech-

nical underpinnings needed to execute your web application haven’t changed, the .NET 3.5 Framework
and ASP.NET add a lot of new features, as you’ll discover in this book.
Probably the best thing about Visual Web Developer 2008 is its price: it’s available for free. Although
the commercial versions of Visual Studio 2008 ship with Visual Web Developer, you can also download
and install the free Express Edition. This makes Visual Web Developer 2008 and ASP.NET 3.5 probably
the most attractive and compelling web development technologies available today.
87593flast.qxd:WroxPro 1/28/08 8:56 AM Page xxiii
www.it-ebooks.info

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×