Introduction |
|
1 | (1) |
|
What does this Book Cover? |
|
|
1 | (2) |
|
|
3 | (1) |
|
What do you Need to use This Book? |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
5 | (4) |
|
How to Download the Sample Code for the Book |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
Why this System Offers the Best Support |
|
|
7 | (2) |
|
Getting Started with ASP.NET |
|
|
9 | (54) |
|
What is a Static Web Page? |
|
|
10 | (1) |
|
How are Static Web Pages Served? |
|
|
11 | (2) |
|
The Limitation of Static Web Pages |
|
|
12 | (1) |
|
|
13 | (1) |
|
How are Dynamic Web Pages Served? |
|
|
13 | (9) |
|
Two Ways of Providing Dynamic Web Page Content |
|
|
14 | (1) |
|
Client-Side Dynamic Web Pages |
|
|
14 | (1) |
|
Server-Side Dynamic Web Pages |
|
|
15 | (2) |
|
An Overview of the Technologies |
|
|
17 | (1) |
|
Client-Side Technologies for Providing Dynamic Content |
|
|
17 | (2) |
|
Server-Side Technologies for Providing Dynamic Content |
|
|
19 | (3) |
|
|
22 | (1) |
|
How does ASP.NET Differ from ASP? |
|
|
22 | (1) |
|
I'm Still Confused about ASP, ASP.NET, and C# |
|
|
23 | (1) |
|
|
23 | (19) |
|
Installing the IIS 5.x Web Server |
|
|
24 | (3) |
|
|
27 | (1) |
|
Testing your Installation |
|
|
28 | (1) |
|
Identifying your Web Server's Name |
|
|
29 | (1) |
|
Browsing to a Page on your Web Server |
|
|
30 | (3) |
|
Managing Directories on your Web Server |
|
|
33 | (1) |
|
|
34 | (5) |
|
|
39 | (3) |
|
Configuring Directory Security |
|
|
42 | (8) |
|
Prerequisites for Installing ASP.NET |
|
|
45 | (1) |
|
Installing ASP.NET and the .NET Framework SDK |
|
|
46 | (4) |
|
Troubleshooting Hints and Tips |
|
|
50 | (1) |
|
|
50 | (3) |
|
|
53 | (7) |
|
Program Not Found, the Result of the ASP.NET Isn't Being Displayed, or The Browser Tries to Download the File |
|
|
53 | (2) |
|
Page Cannot Be Displayed: HTTP Error 403 |
|
|
55 | (1) |
|
Page Cannot Be Found: HTTP Error 404 |
|
|
56 | (2) |
|
Web Page Unavailable while Offine |
|
|
58 | (1) |
|
|
58 | (1) |
|
The Page Displays the Message but not the Time |
|
|
58 | (1) |
|
I Get an Error Statement Citing a Server Error |
|
|
59 | (1) |
|
I Have a Different Problem |
|
|
59 | (1) |
|
|
60 | (3) |
|
Anatomy of an ASP.NET Page |
|
|
63 | (24) |
|
|
63 | (6) |
|
From Your Code to Machine Code |
|
|
65 | (1) |
|
Introducing a Common Intermediate Language |
|
|
66 | (1) |
|
Objects, Objects Everywhere |
|
|
66 | (1) |
|
|
67 | (1) |
|
|
68 | (1) |
|
|
69 | (10) |
|
Saving your ASP.NET Files with an ASPX Suffix |
|
|
69 | (1) |
|
Inserting ASP.NET Code into our Web Pages |
|
|
70 | (1) |
|
|
70 | (6) |
|
Inline Code Blocks (the <% %> Delimiters) |
|
|
76 | (1) |
|
|
77 | (2) |
|
|
79 | (6) |
|
|
79 | (4) |
|
Binding to a Simple XML File |
|
|
83 | (2) |
|
|
85 | (2) |
|
Forms and HTML Server Controls |
|
|
87 | (40) |
|
|
88 | (1) |
|
Web Pages, HTML Forms, and Web Forms |
|
|
88 | (2) |
|
|
90 | (3) |
|
|
91 | (1) |
|
Where ASP.NET Fits in with the .NET Framework |
|
|
92 | (1) |
|
|
93 | (4) |
|
|
93 | (1) |
|
|
94 | (1) |
|
|
94 | (2) |
|
|
96 | (1) |
|
How the <form> Tag Works in ASP.NET |
|
|
97 | (28) |
|
|
98 | (1) |
|
|
98 | (4) |
|
|
102 | (1) |
|
The <asp:dropdownlist> Control |
|
|
103 | (7) |
|
The <asp:listbox> Control |
|
|
110 | (3) |
|
The <asp:textbox> Control |
|
|
113 | (4) |
|
The <asp:radiobutton> and <asp:radiobuttonlist> Controls |
|
|
117 | (4) |
|
The <asp:checkbox> and <asp:checkboxlist> Controls |
|
|
121 | (4) |
|
|
125 | (1) |
|
|
125 | (2) |
|
Storing Information in C# |
|
|
127 | (50) |
|
|
128 | (4) |
|
|
128 | (4) |
|
|
132 | (11) |
|
|
133 | (2) |
|
|
135 | (1) |
|
|
135 | (1) |
|
|
135 | (2) |
|
|
137 | (1) |
|
|
137 | (2) |
|
|
139 | (1) |
|
|
139 | (1) |
|
|
139 | (1) |
|
|
140 | (2) |
|
|
142 | (1) |
|
|
142 | (1) |
|
|
143 | (6) |
|
|
144 | (1) |
|
|
145 | (1) |
|
|
146 | (2) |
|
|
148 | (1) |
|
Converting Between Data Types |
|
|
149 | (11) |
|
|
149 | (2) |
|
|
151 | (1) |
|
|
152 | (1) |
|
|
153 | (1) |
|
|
154 | (1) |
|
|
155 | (1) |
|
What if Conversions Fail? |
|
|
156 | (4) |
|
|
160 | (1) |
|
|
161 | (12) |
|
|
161 | (5) |
|
|
166 | (1) |
|
|
167 | (1) |
|
|
168 | (3) |
|
|
171 | (2) |
|
|
173 | (1) |
|
|
173 | (4) |
|
|
177 | (32) |
|
|
177 | (3) |
|
|
178 | (1) |
|
|
179 | (1) |
|
Examples of Markup Languages |
|
|
180 | (2) |
|
|
180 | (1) |
|
|
181 | (1) |
|
|
182 | (1) |
|
|
182 | (1) |
|
|
183 | (5) |
|
|
188 | (9) |
|
Well-Formed vs. Valid Documents |
|
|
189 | (1) |
|
|
189 | (7) |
|
|
196 | (1) |
|
|
197 | (7) |
|
|
198 | (1) |
|
|
199 | (5) |
|
|
204 | (1) |
|
|
204 | (1) |
|
|
205 | (4) |
|
Control Structures and Procedural Programming |
|
|
209 | (52) |
|
A Quick Look at Control Structures |
|
|
210 | (2) |
|
Overview of Branching Structures |
|
|
210 | (1) |
|
Overview of Looping Structures |
|
|
210 | (1) |
|
|
211 | (1) |
|
When to Use a Particular Control Structure |
|
|
211 | (1) |
|
Branching Structures in Detail |
|
|
212 | (21) |
|
|
213 | (1) |
|
Logical Comparisons Using if |
|
|
213 | (1) |
|
|
214 | (2) |
|
Extending if Statements Using else if and else |
|
|
216 | (3) |
|
The Conditional or Ternary Operator |
|
|
219 | (1) |
|
|
220 | (1) |
|
A Word about Nested ifs and Indenting |
|
|
220 | (7) |
|
Conditional Statements Using Switch...case |
|
|
227 | (3) |
|
Another Note on Nesting and Indenting |
|
|
230 | (3) |
|
Looping Structures in Detail |
|
|
233 | (11) |
|
|
234 | (5) |
|
|
239 | (3) |
|
|
242 | (1) |
|
|
243 | (1) |
|
|
243 | (1) |
|
|
244 | (13) |
|
|
244 | (1) |
|
Return Types and Parameters |
|
|
245 | (1) |
|
|
246 | (5) |
|
|
251 | (1) |
|
|
252 | (3) |
|
|
255 | (2) |
|
|
257 | (1) |
|
|
258 | (3) |
|
Event-driven Programming and Postback |
|
|
261 | (28) |
|
|
262 | (1) |
|
What is Event-driven Programming? |
|
|
263 | (1) |
|
|
263 | (4) |
|
|
267 | (2) |
|
Server Control Events in ASP.NET |
|
|
269 | (6) |
|
The ASP.NET button Server Control |
|
|
272 | (3) |
|
Event-Driven Programming and Postback |
|
|
275 | (5) |
|
|
280 | (1) |
|
Changing the Way we Program on the Web |
|
|
280 | (6) |
|
|
286 | (1) |
|
|
286 | (3) |
|
|
289 | (44) |
|
|
290 | (1) |
|
|
291 | (5) |
|
Abstraction -- Modeling the Real World |
|
|
293 | (1) |
|
Encapsulation -- The Black Box |
|
|
294 | (1) |
|
|
295 | (1) |
|
|
295 | (1) |
|
|
296 | (33) |
|
Where do Objects Come From? |
|
|
296 | (1) |
|
|
297 | (3) |
|
|
300 | (1) |
|
|
301 | (1) |
|
Using Methods and Properties |
|
|
302 | (9) |
|
Initializing Objects with Constructors |
|
|
311 | (5) |
|
|
316 | (8) |
|
|
324 | (3) |
|
An Example of Operator Overloading |
|
|
327 | (1) |
|
More on Operator Overloading |
|
|
328 | (1) |
|
|
329 | (1) |
|
|
330 | (3) |
|
Shared Members and Class Relationships |
|
|
333 | (48) |
|
|
334 | (8) |
|
|
334 | (3) |
|
|
337 | (5) |
|
|
342 | (21) |
|
|
342 | (7) |
|
Containment -- A `Has a' Relationship |
|
|
349 | (3) |
|
|
352 | (2) |
|
|
354 | (3) |
|
Terminology for Inheritance |
|
|
357 | (1) |
|
The Pros and Cons of Inheritance |
|
|
358 | (1) |
|
System.Object -- The Ultimate Base Class |
|
|
358 | (5) |
|
The Limitations of Inheritance |
|
|
363 | (1) |
|
Advanced Inheritance Concepts |
|
|
363 | (14) |
|
|
365 | (2) |
|
Referring to the Current Object -- The this Reference |
|
|
367 | (1) |
|
Abstract Classes and Interfaces |
|
|
367 | (2) |
|
Converting between Object Types |
|
|
369 | (1) |
|
|
370 | (1) |
|
|
371 | (1) |
|
|
372 | (2) |
|
|
374 | (3) |
|
|
377 | (1) |
|
|
378 | (3) |
|
|
381 | (50) |
|
|
382 | (2) |
|
|
384 | (1) |
|
|
384 | (7) |
|
Redirecting the User to Another Page |
|
|
387 | (4) |
|
|
391 | (18) |
|
|
392 | (5) |
|
|
397 | (5) |
|
|
402 | (7) |
|
|
409 | (19) |
|
|
410 | (5) |
|
|
415 | (6) |
|
|
421 | (1) |
|
|
421 | (6) |
|
Shelf Life -- How Long Do Cookies Last? |
|
|
427 | (1) |
|
|
427 | (1) |
|
|
428 | (1) |
|
|
428 | (3) |
|
Objects and Structured Data |
|
|
431 | (30) |
|
|
431 | (13) |
|
Different Types of Collection |
|
|
432 | (1) |
|
|
433 | (3) |
|
|
436 | (3) |
|
Working on Multiple Elements in an Array |
|
|
439 | (3) |
|
|
442 | (1) |
|
Pros and Cons of Working with Arrays |
|
|
443 | (1) |
|
Getting More from Collections |
|
|
444 | (14) |
|
|
444 | (4) |
|
Some More ArrayList Techniques |
|
|
448 | (2) |
|
|
450 | (2) |
|
|
452 | (3) |
|
|
455 | (3) |
|
|
458 | (1) |
|
|
459 | (2) |
|
Reading from Data Sources |
|
|
461 | (38) |
|
Understanding Modern Databases |
|
|
461 | (4) |
|
|
462 | (1) |
|
Normalization and Relational Databases |
|
|
463 | (2) |
|
|
465 | (27) |
|
|
467 | (1) |
|
|
468 | (1) |
|
|
469 | (1) |
|
|
470 | (6) |
|
The Command Object and DataReader |
|
|
476 | (6) |
|
|
482 | (3) |
|
The DataSet and DataTable Objects |
|
|
485 | (4) |
|
Microsoft SQL Server and ADO.NET |
|
|
489 | (3) |
|
|
492 | (4) |
|
|
496 | (1) |
|
|
497 | (2) |
|
Manipulating Data Sources |
|
|
499 | (42) |
|
|
500 | (1) |
|
|
500 | (1) |
|
|
501 | (2) |
|
|
503 | (8) |
|
Updating the Original Data Source |
|
|
511 | (1) |
|
|
511 | (1) |
|
|
512 | (2) |
|
The CommandBuilder Object |
|
|
514 | (4) |
|
The DataAdapter.Update Method |
|
|
518 | (5) |
|
|
523 | (1) |
|
|
523 | (1) |
|
|
524 | (5) |
|
Adapting the DataAdapter Commands |
|
|
524 | (1) |
|
|
525 | (2) |
|
|
527 | (2) |
|
|
529 | (1) |
|
|
529 | (7) |
|
|
533 | (1) |
|
|
533 | (3) |
|
|
536 | (1) |
|
|
537 | (1) |
|
|
537 | (4) |
|
|
541 | (62) |
|
|
543 | (3) |
|
|
543 | (1) |
|
HTML Server Controls vs. ASP.NET Server Controls |
|
|
544 | (1) |
|
|
545 | (1) |
|
|
546 | (5) |
|
|
546 | (1) |
|
Automatic Browser Detection |
|
|
546 | (1) |
|
|
547 | (1) |
|
|
548 | (3) |
|
|
551 | (49) |
|
|
551 | (1) |
|
|
552 | (1) |
|
|
552 | (9) |
|
|
561 | (1) |
|
|
561 | (1) |
|
|
562 | (1) |
|
|
563 | (3) |
|
|
566 | (4) |
|
The XML Source -- MyCalendar.xml |
|
|
570 | (1) |
|
The Web Form -- MyCalendar.aspx |
|
|
571 | (14) |
|
Editing the Data Using Templates |
|
|
585 | (15) |
|
|
600 | (1) |
|
|
601 | (2) |
|
Reusable Code for ASP.NET |
|
|
603 | (30) |
|
|
603 | (1) |
|
|
604 | (3) |
|
|
605 | (1) |
|
Applying Component Theory to our Applications |
|
|
606 | (1) |
|
|
607 | (14) |
|
When Should we use User Controls? |
|
|
608 | (13) |
|
|
621 | (7) |
|
|
625 | (3) |
|
|
628 | (2) |
|
|
630 | (1) |
|
|
631 | (2) |
|
NET Assemblies and Custom Controls |
|
|
633 | (40) |
|
Three-Tier Application Design |
|
|
634 | (1) |
|
ASP.NET Application Design |
|
|
635 | (1) |
|
|
636 | (23) |
|
|
638 | (4) |
|
Accessing a Component from within an ASP.NET Page |
|
|
642 | (3) |
|
|
645 | (1) |
|
Accessing Assemblies in Other Locations |
|
|
646 | (1) |
|
Writing Code in Other Languages |
|
|
647 | (3) |
|
|
650 | (9) |
|
|
659 | (4) |
|
What are Custom Controls? |
|
|
659 | (1) |
|
How are Custom Controls Different from User Controls? |
|
|
659 | (1) |
|
How are Custom Controls different from Business Objects? |
|
|
659 | (4) |
|
|
663 | (6) |
|
|
669 | (1) |
|
|
669 | (4) |
|
Debugging and Error Handling |
|
|
673 | (50) |
|
|
674 | (1) |
|
|
674 | (13) |
|
How and from where do Errors Arise? |
|
|
677 | (1) |
|
|
677 | (2) |
|
|
679 | (3) |
|
|
682 | (4) |
|
|
686 | (1) |
|
|
687 | (9) |
|
|
688 | (2) |
|
|
690 | (1) |
|
|
690 | (3) |
|
|
693 | (2) |
|
Application-Level Tracing |
|
|
695 | (1) |
|
|
696 | (15) |
|
|
697 | (1) |
|
Structured Error Handling |
|
|
697 | (1) |
|
|
698 | (1) |
|
Using try...catch...finally |
|
|
699 | (1) |
|
|
700 | (2) |
|
What You Can Put in a catch Block |
|
|
702 | (1) |
|
|
703 | (1) |
|
Generating Exceptions using throw |
|
|
703 | (3) |
|
|
706 | (3) |
|
Handling Errors Programmatically |
|
|
709 | (2) |
|
|
711 | (9) |
|
Customized Error Messages |
|
|
712 | (3) |
|
|
715 | (1) |
|
System. Diagnostics Namespace |
|
|
715 | (3) |
|
Mailing the Site Administrator |
|
|
718 | (1) |
|
System. Web. Mail Namespace |
|
|
718 | (2) |
|
|
720 | (3) |
|
|
723 | (38) |
|
|
724 | (4) |
|
HTTP, XML, and Web Services |
|
|
728 | (5) |
|
|
729 | (1) |
|
|
730 | (1) |
|
Simple Object Access Protocol (SOAP) |
|
|
731 | (2) |
|
Building an ASP.NET Web Service |
|
|
733 | (13) |
|
|
733 | (1) |
|
|
734 | (1) |
|
|
734 | (1) |
|
|
734 | (3) |
|
|
737 | (3) |
|
|
740 | (6) |
|
|
746 | (6) |
|
|
746 | (2) |
|
|
748 | (4) |
|
|
752 | (1) |
|
|
753 | (2) |
|
Username-Password Combination or Registration Keys |
|
|
753 | (1) |
|
Secure Sockets Layer (SSL) |
|
|
754 | (1) |
|
|
755 | (1) |
|
|
755 | (3) |
|
|
755 | (1) |
|
Asynchronous Method Calls |
|
|
756 | (1) |
|
Service Hijacking (or Piggybacking) |
|
|
757 | (1) |
|
|
757 | (1) |
|
The Interdependency Scenario |
|
|
757 | (1) |
|
|
758 | (1) |
|
|
758 | (3) |
|
Configuration and Optimization |
|
|
761 | (24) |
|
|
762 | (5) |
|
|
762 | (1) |
|
|
763 | (2) |
|
|
765 | (1) |
|
Configuration File Format |
|
|
766 | (1) |
|
The Structure of the Configuration Files |
|
|
767 | (4) |
|
|
767 | (1) |
|
|
768 | (1) |
|
|
769 | (1) |
|
|
769 | (2) |
|
|
771 | (8) |
|
|
771 | (1) |
|
|
771 | (3) |
|
|
774 | (1) |
|
|
775 | (4) |
|
Monitoring the ASP.NET Process |
|
|
779 | (3) |
|
|
782 | (1) |
|
|
783 | (2) |
|
|
785 | (36) |
|
|
785 | (1) |
|
|
786 | (1) |
|
|
786 | (31) |
|
Implementing Basic Authentication |
|
|
787 | (11) |
|
Weighing up Basic Authentication |
|
|
798 | (1) |
|
Integrated Windows Authentication |
|
|
799 | (3) |
|
Weighing up Integrated Windows Authentication |
|
|
802 | (1) |
|
Implementing Forms-based Authentication |
|
|
803 | (9) |
|
Forms-based Authentication using a database |
|
|
812 | (5) |
|
|
817 | (1) |
|
Microsoft Passport Authentication |
|
|
817 | (1) |
|
What is Microsoft Passport? |
|
|
817 | (1) |
|
|
817 | (1) |
|
Technologies supported by Passport |
|
|
818 | (1) |
|
|
818 | (3) |
Index |
|
821 | |