David Sussman and Alex Homer
Programmer to Programmer
David Sussman is a hacker in the traditional sense of the word. That’s someone who likes playing with
code and working out how things work, which is why he spends much of his life working with beta
software. Luckily, this coincides with writing about new technologies, giving him an output for his
poor English and grammar. He lives in a small village in the Oxfordshire countryside. Like many
programmers everywhere, he has an expensive hi-fi, a big TV, and no life. You can contact Dave through
his own company, ipona Limited: davids@ipona.co.uk.
Alex Homer is a computer geek and Web developer with a passion for ASP.NET. Although he has to
spend some time doing real work (a bit of consultancy and training, and the occasional conference
session), most of his days are absorbed in playing with the latest Microsoft Web technology and then
writing about it. Living in the picturesque wilderness of the Derbyshire Dales in England, he is well
away from the demands of the real world—with only an Internet connection to maintain some distant
representation of normality. But, hey, what else could you want from life? You can contact Alex through
his own software company, Stonebroom Limited: alex@stonebroom.com.
Acknowledgments
Producing a book like this is a huge development effort that involves a lot of people—many of whom
work behind the scenes and never get the public recognition they deserve. In an attempt to recognize
this, we would like to thank everyone at the publishers, John Wiley & Sons, who worked so hard to turn
our manuscripts into a book.
However, none of this would have been possible without the help of the ASP.NET team at Microsoft. In
particular, Scott Guthrie—who’s unique vision for ASP.NET as a development environment, and willingness
to share his visions and provide support for the community as a whole—made our task so much
easier. Thanks guys, and keep on building great Web programming tools!
Introduction
This book shows you just how powerful, and yet easy to use, the new Web development environment
from Microsoft really is. Visual Web Developer 2005 Express Edition, along with the relational database SQL Server 2005 Express Edition, allows you to build great Web sites using drag-and-drop techniques, wizards, and a huge range of developer-friendly tools and controls. The book demonstrates this by leading you through the creation of a fully featured and highly interactive e-commerce Web application, like those you are used to seeing on the Internet today.
Visual Web Developer is an environment based on the latest release of the Microsoft .NET Framework,
version 2.0, which includes the Web programming and runtime features that make up ASP.NET 2.0.
ASP.NET has evolved over the previous several years from the original Microsoft Active Server pages
(ASP) scripting platform that pioneered many of the current techniques in Web programming.
However, ASP.NET leaves the scripting world behind. It offers a development environment that
generates compiled code, includes a full range of tools that enable implementation of even the most
complex feature quickly and easily, and provides plenty of resource-based help and code creation
assistance. On top of all this, the execution efficiency of the .NET platform means that your Web sites
and applications run more quickly and reliably than ever before.
This is not a reference book. You will not find listings of the objects, classes, properties, and methods
of each feature in ASP.NET. Instead, this book is task-focused to provide you with the experience of
working in Visual Web Developer, quickly getting to grips with the environment and ASP.NET,
and learning how to achieve the kinds of requirements you will meet every day as you build your
applications. For example, after a brief section on installing Visual Web Developer and an introduction
to the development environment, Chapter 1 gets you building pages that display and allow you to edit
the data in a database.
As you progress through the book, you will learn about the following:
❑ Designing the structure of your Web site
❑ Implementing the database
❑ Displaying and editing data
❑ Building a shopping cart
❑ Publishing your finished site
All of the tools and examples you need are on the CD-ROM provided with this book, and you can run
the finished example on your own machine—or even on our Web site at www.daveandal.net/books/8079.
So, what are you waiting for? Power up your machine, install Visual Web Developer, and get started
building your next great Web site!
Product details
Price
|
|
---|---|
File Size
| 12,866 KB |
Pages
|
314 p |
File Type
|
PDF format |
ISBN-13
ISBN-10 | 978-0-7645-8807-5 0-7645-8807-9 |
Copyright
| 2006 by Wiley Publishing, Inc |
Contents
Acknowledgments ix
Introduction xi
Chapter 1: Getting Started
About the Example Application 2
Installing Visual Web Developer 3
Step by Step—Using the Setup Wizard 3
Step by Step—Installing the PPQ Example Files 7
Viewing the PPQ Example Database 10
Step by Step—Viewing the PPQ Database 10
Reading and Displaying Data with ASP.NET 20
Summary 30
Chapter 2: Designing a Web Site
Designing a Web Site 31
Making Web Sites Accessible 32
Multilingual Web Sites and Globalization 32
Designing the Appearance of the Site 33
Templates and Master Pages 34
Navigation and Menus 35
Text Styles and Style Sheets 35
Designing the Underlying Workings of the Site 36
Data Access 36
Building a Master Page and Content Page 37
Creating the Page Structure as a Master Page 37
Choosing the Correct Element and Control Type 48
Adding the Navigation Links 48
Building Your First Content Page 55
Converting an Existing Page to a Content Page 60
Checking for Accessibility 63
Summary 65
Chapter 3: Building the PPQ Database
Designing the PPQ Database 68
Storing the Menu Items Data 68
Applying the Rules of Normalization 69
Applying the Remaining Normalization Rules 70
Storing the Orders Data 72
The OrderItems Table 73
The Final Database Design 74
Creating and Modifying Databases in VWD 76
The Table Designer Window 78
The Query Window 80
Creating a New Database 81
Creating the PPQ OrderItems Table 82
Defining Relationships between Tables 88
Defining Relationships in the Table Designer 88
Defining Relationships with a Database Diagram 90
Extracting and Displaying the Menu Items 94
Extracting Data with a Custom SQL Statement 94
Creating a Stored Procedure 101
Using a View Instead of a Table or Stored Procedure 104
Summary 105
Chapter 4: Accessing and Displaying Data
Data Source and Data Display Controls 108
The Object-Oriented and Event-Driven Architecture 109
About the GridView Control 110
Using Different Column Types in a GridView 111
Using Data Display Control Templates 117
The DetailsView and FormView Controls 123
Using a DetailsView and FormView Control 123
Summary 127
Chapter 5: Displaying Nested and XML Data
Building Nested Data Displays 130
Creating Nested Data Displays Declaratively 131
Writing Code to Access and Display Nested Data 143
The DataReader and DataSet Objects 144
Using a DataReader with a Data Source Control 144
Generating a Single DataSet with Relationships 145
How the Code in the ShowMenu.aspx Page Works 153
User Controls and Binding to XML Data 157
Building the Delivery Costs Page 158
Building the Text Links User Control 162
Converting the XML with an XSLT Style Sheet 163
Creating the User Control 164
Converting Parts of a Page into a User Control 170
Summary 170
Chapter 6: Managing and Editing Data
Data Source Controls 173
Adding New Rows 186
Summary 193
Chapter 7: Placing an Order
The Order Process 196
Understanding Classes 197
Creating the Shopping Cart 198
The Shopping Cart Classes 198
The Shopping Cart Data Layer 212
The ObjectDataSource Control 212
The Data Layer Classes 213
Creating the Order Page 219
The Shopping Cart Page 225
Summary 234
Chapter 8: The Checkout Process
Paying for the Order 235
Collecting the Delivery Address 239
Collecting the Payment Details 245
Confirming the Order 248
Completing the Order 253
Understanding Exception Handling 260
Understanding Transactions 262
Summary 263
Chapter 9: Security and Deployment
Configuring Security 265
Modifying the Menu 273
Publishing a Site 276
Summary 278
Index 281
●▬▬▬▬▬❂❂❂▬▬▬▬▬●
●▬▬❂❂▬▬●
●▬❂▬●
●❂●