Teach Yourself Visual Basic .NET Web
Programming in 21 Days
Peter Aitken and Phil Syme
Published by Sams, 2002
522 pages, $39.99
A complete, hands-on guide to all aspects of Web programming
using Microsoft's new .NET Framework and the vastly improved Visual Basic
Table of Contents
WEEK 1. AT A GLANCE.
Day 1. Introducing Web Programming with .NET.
What Is the .NET Framework?
Configuring Your Environment.
Internet Applications and Request Processing.
Creating a Web Service.
Running the Code Listings.
Day 2. Introducing ASP.NET.
What Is ASP.NET?
Your First ASP.NET Page.
Defining Web Forms.
Coding Behind Forms in ASP.NET.
Creating a Web Application with Visual Studio.NET.
The Response Object.
The Request Object.
Handy Methods in the Page Class.
How ASP.NET Works.
Day 3. Using Web Forms.
Understanding How Web Forms Are Processed.
Performing Basic State Management in Web Applications.
Using Hidden Fields and Query Strings.
Working with the Session Object.
Working with the Application Object.
Setting Up Global Objects with the global.asax File.
Configuring the Application.
Day 4. Working with Web Controls.
Understanding the Benefits of Web Controls.
Understanding the Common Features of Web Controls.
Working on the Web Controls Example.
Working with Validation Controls.
Data Binding: Integrating Results with Code.
Beautifying Your Controls.
Day 5. Using Advanced ASP.NET Web Controls.
Building Controls with Code.
Repeating Templates with the Repeater Control.
Displaying Tables with the DataGrid Control.
Displaying Data with the DataList Control.
Day 6. Working with User Controls.
Understanding User Controls.
Creating Code Behind User Controls.
Caching Web Forms.
Caching User Controls.
Day 7. Writing Internet Applications for Mobile Devices.
Introducing Mobile Device Support.
Creating Mobile Web Forms.
Working with Mobile Web Controls.
Customizing Pages by Device Type.
Using Style Sheets.
Understanding State Management Issues.
Week 1. In Review.
WEEK 2. AT A GLANCE.
Day 8. Using XML with Your Application.
What Is XML?
What Is XSL?
Understanding the Document Object Model (DOM).
Day 9. Introducing ADO.NET.
Why ADO.NET? Setting Up the Database.
Using Database Connections.
Changing Data by Using Database Commands.
Day 10. Working with Datasets.
What Are DataSets and DataAdapters?
Reading Data into a Dataset.
Changing Data with a Dataset.
Handling DataAdapter Errors.
Working with Multiple Tables.
Using Visual Studio.NET.
Using Additional DataTable Features.
Day 11. Using ADO.NET and XML Together.
Manipulating XML Files Using ADO.NET.
Understanding XML Schemas.
Creating XSD Files.
I Have an XML Schema-Now What?.
Day 12. Putting It All Together with ASP.NET.
Taking a Second Look at Data Binding.
Revisiting the DataView.
Performing Some DataGrid Tricks.
Day 13. Introducing Web Services.
Why Use Web Services?
Implementing Your First Web Service.
Testing the Web Service.
Implementing the Web Service Client.
Understanding How Web Services Work.
Day 14. Publishing Web Services.
How Do Web References Work?
What Is UDDI?
Week 2. In Review.
WEEK 3. AT A GLANCE.
Day 15. Consuming a Web Service.
Passing Parameters and Web Services.
Accessing Data with Web Services.
Day 16. Putting It All Together with Web Services.
Managing State in Web Services.
Dealing with Slow Services.
Day 17. Using Legacy Code with .NET.
Using ASP and ASP.NET Together.
Using COM Components.
Using .NET Components in Legacy Applications.
Day 18. Configuring Internet Applications.
XML and the Web.Config File.
Examining Configuration Files.
Adding Tracing and Debugging.
Customizing Project Compilation.
Adding Error Handling to ASP.NET Pages.
Configuring Session State.
Configuring the ASP.NET Process.
Configuring ASP.NET Pages.
Adding Custom Configuration Sections.
Day 19. Securing Internet Applications.
Understanding Network Security Issues.
Using HTTPS for Encryption.
Understanding Security Terms.
Understanding Authorization and Impersonation.
Setting Up URL Authorization.
Setting Up Authentication for Web Services.
Day 20. Deploying Internet Applications.
Deploying Web Applications with XCOPY and FTP.
Copying Projects with Visual Studio.
Creating Powerful Setup Programs.
Day 21. Creating Your Application Architecture.
Applications with Great "PARSSeM".
Looking at Logical and Physical Architecture.
Performance and Scalability.
DNA for .NET.
PARSSeM and .NET.
Week 3. In Review.
Appendix A. Answers to Quizzes and Exercises.
Installing Visual Studio.NET. Be aware that your local Web server must be
installed before you install VS.
This minor fix applies throughout the book. When creating a new web service
or other web application the book tells you to enter the application name in the
Name box on the New Project page (figure 1.4). Visual Studio net has changed so
that you must enter the name in the Location box. The name must be typed after
the Web server URL, so that for a program called "First Service" the Location
box should read "http://localhost/FirstService"
The second line of code on the page reads:
Dim strPhoneNumber As Strong =
The data type should be "String" and not
Listing 2.7 requires these corrections:
Line 8: change "nKeyIndex" to "nKeyIdx"
Line 10: delete the semicolon
Lines 11 & 12: change as follows:
Response.Write( "<tr><td>" &
Vars.GetKey(nKeyIdx) & "</td>")
Response.Write( "<td>" & Vars(nKeyIdx) & "</td></tr>" )
In Listing 2.9 there is a stray semicolon at the end of the 4th line - delete
In the analysis section, two lines of code end with a semicolon - the
semicolons should be deleted.
At the end of Listing 3.10 there is a comment detailing how to compile the
class. It mistakenly uses "myclass.cs" when it should use "myclass.vb".
The first line of code should be moved down so it comes after the Imports
Also, the note on how to compile at the end of this listing specifies "globalclass.cs"
when it should say "globalclass.vb". In addition the command line used to
compile this listing must also include a reference to the system.web.dll file:
/t:library /r:system.dll /r:system.web.dll globalclass.vb
Listing 6.7, line 28 should read:
Dim tsDaysLeft as Timespan =
A reader pointed out that Listing 10.1 will not display table cells correctly
for cells that happen to contain an empty string. He suggested the following
fix. Add the following declaration at the start of the code (just before line
Dim str as string
Then replace line 23 with the following 3 lines:
str = r(i).ToString()
if str = "" then str = " "
Response.Write("<td>" + str + "</td>")
Click the link below to download a ZIP file that contains the book's
listings. When you unpack the ZIP you will have a folder for each of the book's
chapters that contains listings, and a file in each folder for each of the
numbered listings. If the listing is given a specific name in the book it will
have that same name in the download. Otherwise it will be named as per the
listing, for example List0502.txt. You can then copy and paste code from the
listings into your Visual Studio projects. Note that any code corrections listed on this
page will also have been made in the download listings.