E-Book, Englisch, 1080 Seiten
MacDonald Beginning ASP.NET 4 in VB 2010
1. ed
ISBN: 978-1-4302-2612-3
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
E-Book, Englisch, 1080 Seiten
ISBN: 978-1-4302-2612-3
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
The most up-to-date and comprehensive introductory ASP.NET book you'll find on any shelf, Beginning ASP.NET 4 in VB 2010 guides you through Microsoft's latest technology for building dynamic web sites. This book will enable you to build dynamic web pages on the fly, and assumes only the most basic knowledge of Visual Basic. The book provides exhaustive coverage of ASP.NET, guiding you from your first steps right up to the most advanced techniques, such as querying databases from within a web page and tuning your site for optimal performance. Within these pages, you'll find tips for best practices and comprehensive discussions of key database and XML principles you need to know in order to be effective with ASP.NET. The book also emphasizes the invaluable coding techniques of object orientation and code-behind, which will start you off on the track to building real-world web sites right from the beginning-rather than just faking it with simplified coding practices. By the time you've finished the book, you will have mastered the core techniques and have all the knowledge you need to begin work as a professional ASP.NET developer.
Matthew MacDonald is an author,educator, and MCSD developer who has a passion for emerging technologies. He isthe author of more than a dozen books about .NET programming. In a dimly-remembered past life, he studied English literature and theoretical physics.
Autoren/Hrsg.
Weitere Infos & Material
1;Title page ;1
2;Copyright page ;2
3;Table of contents ;4
4;About the Author;24
5;About the Technical Reviewer;25
6;Acknowledgments;26
7;Introduction;27
7.1;About This Book;27
7.1.1;Who Should Read This Book;28
7.1.2;What You Need to Use This Book;29
7.2;Code Samples;29
7.3;Chapter Overview;30
7.3.1;Part 1: Introducing .NET;30
7.3.2;Part 2: Developing ASP.NET Applications;30
7.3.3;Part 3: Building Better Web Forms;30
7.3.4;Part 4: Working with Data;30
7.3.5;Part 5: Website Security;31
7.3.6;Part 6: Advanced ASP.NET;31
7.4;Feedback;31
8;PART 1 Introducing .NET;32
9;CHAPTER 1 The .NET Framework;33
9.1;The Evolution of Web Development;33
9.1.1;HTML and HTML Forms;33
9.1.2;Server-Side Programming;36
9.1.3;Client-Side Programming;37
9.2;The .NET Framework;39
9.2.1;VB, C#, and the .NET Languages;41
9.2.1.1;Intermediate Language;41
9.2.2;The Common Language Runtime;43
9.2.3;The .NET Class Library;44
9.2.4;Visual Studio;45
9.3;The Last Word;46
10;CHAPTER 2 The Visual Basic Language;47
10.1;The .NET Languages;47
10.2;Variables and Data Types;48
10.2.1;Assignment and Initializers;50
10.2.2;Arrays;51
10.2.2.1;The ArrayList;53
10.2.3;Enumerations;53
10.3;Variable Operations;55
10.3.1;Advanced Math;56
10.3.2;Type Conversions;57
10.4;Object-Based Manipulation;58
10.4.1;The String Type;59
10.4.2;The DateTime and TimeSpan Types;61
10.4.3;The Array Type;63
10.5;Conditional Logic;65
10.5.1;The If . . . End If Block;65
10.5.2;The Select Case Block;66
10.6;Loops;67
10.6.1;The For ... Next Block;67
10.6.2;The For Each Block;68
10.6.3;The Do . . . Loop Block;69
10.7;Methods;70
10.7.1;Parameters;71
10.7.2;Method Overloading;71
10.7.3;Optional and Named Parameters;72
10.7.4;Delegates;73
10.8;The Last Word;75
11;CHAPTER 3 Types, Objects, and Namespaces;76
11.1;The Basics of Classes;76
11.1.1;Shared and Instance Members;77
11.1.2;A Simple Class;78
11.2;Building a Basic Class;78
11.2.1;Creating an Object;80
11.2.2;Adding Properties;81
11.2.3;Automatic Properties;83
11.2.4;Adding a Method;83
11.2.5;Adding a Constructor;84
11.2.6;Adding an Event;85
11.2.6.1;Handling an Event;86
11.2.6.2;Declarative Event Handling;87
11.2.7;Testing the Product Class;88
11.3;Value Types and Reference Types;90
11.3.1;Assignment Operations;90
11.3.2;Equality Testing;91
11.3.3;Passing Parameters by Reference and by Value;91
11.3.4;Reviewing .NET Types;92
11.4;Understanding Namespaces and Assemblies;93
11.4.1;Using Namespaces;95
11.4.2;Importing Namespaces;96
11.4.3;Assemblies;97
11.5;Advanced Class Programming;97
11.5.1;Inheritance;98
11.5.2;Shared Members;99
11.5.3;Casting Objects;100
11.5.4;Partial Classes;102
11.5.5;Generics;104
11.6;The Last Word;105
12;PART 2 Developing ASP.NETApplications;106
13;CHAPTER 4 Visual Studio;107
13.1;The Promise of Visual Studio;107
13.2;Creating Websites;108
13.2.1;Creating an Empty Web Application;109
13.2.2;Websites and Web Projects;113
13.2.3;The Hidden Solution Files;114
13.2.4;The Solution Explorer;115
13.2.5;Adding Web Forms;116
13.2.6;Migrating a Website from a Previous Version of Visual Studio;117
13.3;Designing a Web Page;119
13.3.1;Adding Web Controls;120
13.3.2;The Properties Window;122
13.4;The Anatomy of a Web Form;124
13.4.1;The Web Form Markup;124
13.4.2;The Page Directive;125
13.4.3;The Doctype;126
13.4.4;The Essentials of XHTML;128
13.4.4.1;Elements;129
13.4.4.2;Attributes;131
13.4.4.3;Formatting;132
13.4.4.4;A Complete Web Page;132
13.5;Writing Code;134
13.5.1;The Code-Behind Class;134
13.5.2;Adding Event Handlers;134
13.5.3;Outlining;136
13.5.4;IntelliSense;137
13.5.4.1;Member List;137
13.5.4.2;Error Underlining;139
13.5.4.3;AutoCorrect;141
13.5.5;Code Formatting and Coloring;142
13.6;Visual Studio Debugging;142
13.6.1;The Visual Studio Web Server;143
13.6.2;Single-Step Debugging;144
13.6.3;Variable Watches;149
13.7;The Last Word;150
14;CHAPTER 5 Web Form Fundamentals;151
14.1;The Anatomy of an ASP.NET Application;151
14.1.1;ASP.NET File Types;152
14.1.2;ASP.NET Application Directories;153
14.2;Introducing Server Controls;154
14.2.1;HTML Server Controls;155
14.2.2;Converting an HTML Page to an ASP.NET Page;155
14.2.3;View State;158
14.2.4;The HTML Control Classes;159
14.2.5;Adding the Currency Converter Code;162
14.2.6;Behind the Scenes with the Currency Converter;165
14.3;Improving the Currency Converter;167
14.3.1;Adding Multiple Currencies;167
14.3.1.1;Dissecting the Code . . .;168
14.3.2;Storing Information in the List;168
14.3.3;Adding Linked Images;170
14.3.4;Setting Styles;172
14.4;A Deeper Look at HTML Control Classes;173
14.4.1;HTML Control Events;173
14.4.2;Advanced Events with the HtmlInputImage Control;174
14.4.3;The HtmlControl Base Class;176
14.5;The Page Class;178
14.5.1;Sending the User to a New Page;179
14.5.2;HTML Encoding;180
14.6;Application Events;182
14.6.1;The global.asax File;183
14.6.2;Additional Application Events;184
14.7;ASP.NET Configuration;185
14.7.1;The web.config File;185
14.7.2;Nested Configuration;186
14.7.3;Storing Custom Settings in the web.config File;188
14.7.4;The Website Administration Tool (WAT);190
14.8;The Last Word;192
15;CHAPTER 6 Web Controls;194
15.1;Stepping Up to Web Controls;194
15.1.1;Basic Web Control Classes;195
15.1.1.1;The Web Control Tags;196
15.2;Web Control Classes;197
15.2.1;The WebControl Base Class;198
15.2.2;Units;200
15.2.3;Enumerations;200
15.2.4;Colors;201
15.2.5;Fonts;202
15.2.6;Focus;204
15.2.7;The Default Button;204
15.3;List Controls;205
15.3.1;Multiple-Select List Controls;206
15.3.2;The BulletedList Control;208
15.4;Table Controls;209
15.5;Web Control Events and AutoPostBack;214
15.5.1;How Postback Events Work;218
15.5.2;The Page Life Cycle;219
15.5.2.1;Dissecting the Code . . .;222
15.6;A Simple Web Page;222
15.6.1;Improving the Greeting Card Generator;227
15.6.2;Generating the Cards Automatically;229
15.7;The Last Word;231
16;CHAPTER 7 Error Handling, Logging, andTracing;232
16.1;Common Errors;232
16.2;Exception Handling;234
16.2.1;The Exception Class;234
16.2.2;The Exception Chain;236
16.3;Handling Exceptions;237
16.3.1;Catching Specific Exceptions;238
16.3.2;Nested Exception Handlers;239
16.3.2.1;Dissecting the Code . . .;240
16.3.3;Exception Handling in Action;241
16.3.4;Mastering Exceptions;242
16.4;Throwing Your Own Exceptions;243
16.5;Logging Exceptions;247
16.5.1;Viewing the Windows Event Logs;247
16.5.2;Writing to the Event Log;250
16.5.3;Custom Logs;252
16.5.4;A Custom Logging Class;254
16.5.5;Retrieving Log Information;255
16.6;Page Tracing;257
16.6.1;Enabling Tracing;258
16.6.2;Tracing Information;258
16.6.2.1;Request Details;261
16.6.2.2;Trace Information;261
16.6.2.3;Control Tree;261
16.6.2.4;Session State and Application State;262
16.6.2.5;Request Cookies and Response Cookies;262
16.6.2.6;Headers Collection;263
16.6.2.7;Form Collection;264
16.6.2.8;Query String Collection;264
16.6.2.9;Server Variables;264
16.6.3;Writing Trace Information;264
16.6.4;Application-Level Tracing;268
16.7;The Last Word;270
17;CHAPTER 8 State Management;271
17.1;The Problem of State;271
17.2;View State;271
17.2.1;The ViewState Collection;272
17.2.2;A View State Example;272
17.2.3;Making View State Secure;273
17.2.3.1;Tamper-Proof View State;274
17.2.3.2;Private View State;274
17.2.4;Retaining Member Variables;275
17.2.5;Storing Custom Objects;277
17.3;Transferring Information Between Pages;278
17.3.1;Cross-Page Posting;278
17.3.1.1;Getting More Information from the Source Page;280
17.3.2;The Query String;284
17.3.2.1;A Query String Example;285
17.3.2.2;URL Encoding;287
17.4;Cookies;288
17.4.1;A Cookie Example;289
17.5;Session State;290
17.5.1;Session Tracking;291
17.5.2;Using Session State;291
17.5.3;A Session State Example;293
17.6;Session State Configuration;295
17.6.1;Cookieless;296
17.6.2;Timeout;299
17.6.3;Mode;300
17.6.3.1;InProc;300
17.6.3.2;Off;300
17.6.3.3;StateServer;300
17.6.3.4;SQLServer;302
17.6.3.4.1;Custom;303
17.6.3.5;Compression;304
17.7;Application State;304
17.8;An Overview of State Management Choices;306
17.9;The Last Word;308
18;PART 3 Building Better Web Forms;309
19;CHAPTER 9 Validation;310
19.1;Understanding Validation;310
19.1.1;The Validation Controls;311
19.1.2;Server-Side Validation;312
19.1.3;Client-Side Validation;312
19.2;The Validation Controls;312
19.2.1;A Simple Validation Example;314
19.2.2;Other Display Options;316
19.2.3;Manual Validation;319
19.2.4;Validating with Regular Expressions;321
19.2.4.1;Literals and Metacharacters;321
19.2.4.2;Finding a Regular Expression;322
19.2.5;A Validated Customer Form;325
19.2.6;Validation Groups;329
19.3;The Last Word;331
20;CHAPTER 10 Rich Controls;332
20.1;The Calendar;332
20.1.1;Formatting the Calendar;334
20.1.2;Restricting Dates;336
20.2;The AdRotator;340
20.2.1;The Advertisement File;340
20.2.2;The AdRotator Class;342
20.3;Pages with Multiple Views;343
20.3.1;The MultiView Control;345
20.3.1.1;Creating Views;346
20.3.1.2;Showing a View;347
20.3.2;The Wizard Control;350
20.3.2.1;Wizard Steps;350
20.3.2.2;Wizard Events;354
20.3.2.3;Formatting the Wizard;355
20.3.2.4;Validation with the Wizard;357
20.4;The Last Word;358
21;CHAPTER 11 User Controls and Graphics;359
21.1;User Controls;359
21.1.1;Creating a Simple User Control;360
21.1.2;Independent User Controls;363
21.1.3;Integrated User Controls;365
21.1.4;User Control Events;368
21.1.5;Passing Information with Events;370
21.2;Dynamic Graphics;373
21.2.1;Basic Drawing;373
21.2.2;Drawing a Custom Image;376
21.2.3;Placing Custom Images Inside Web Pages;377
21.2.4;Image Format and Quality;379
21.3;The Last Word;381
22;CHAPTER 12 Styles, Themes, and Master Pages;382
22.1;Styles;382
22.1.1;Style Types;383
22.1.2;Creating a Basic Inline Style;383
22.1.2.1;The Style Builder;384
22.1.2.2;The CSS Properties Window;389
22.1.2.3;Style Inheritance;391
22.1.3;Creating a Style Sheet;392
22.1.3.1;The CSS Outline Window;394
22.1.4;Applying Style Sheet Rules;395
22.1.4.1;The Apply Styles Window;396
22.1.4.2;Creating More Styles;397
22.2;Themes;398
22.2.1;How Themes Work;398
22.2.2;Applying a Simple Theme;400
22.2.3;Handling Theme Conflicts;401
22.2.4;Creating Multiple Skins for the Same Control;403
22.2.5;More Advanced Skins;404
22.3;Master Page Basics;406
22.3.1;A Simple Master Page and Content Page;407
22.3.2;How Master Pages and Content Pages Are Connected;411
22.3.3;A Master Page with Multiple Content Regions;413
22.3.4;Default Content;416
22.3.5;Master Pages and Relative Paths;417
22.4;Advanced Master Pages;418
22.4.1;Style-Based Layouts;418
22.4.2;Code in a Master Page;423
22.4.3;Interacting with a Master Page Programmatically;424
22.5;The Last Word;425
23;CHAPTER 13 Website Navigation;426
23.1;Site Maps;426
23.1.1;Defining a Site Map;427
23.1.1.1;Rule 1: Site Maps Begin with the Element;428
23.1.1.2;Rule 2: Each Page Is Represented by a Element;428
23.1.1.3;Rule 3: A Element Can Contain Other Elements;429
23.1.1.4;Rule 4: Every Site Map Begins with a Single ;430
23.1.1.5;Rule 5: Duplicate URLs Are Not Allowed;430
23.1.2;Seeing a Simple Site Map in Action;431
23.1.3;Binding an Ordinary Page to a Site Map;432
23.1.4;Binding a Master Page to a Site Map;433
23.1.5;Binding Portions of a Site Map;435
23.1.5.1;Showing Subtrees;436
23.1.5.2;Using Different Site Maps in the Same File;439
23.1.6;The SiteMap Class;440
23.2;URL Mapping and Routing;442
23.2.1;URL Mapping;443
23.2.2;URL Routing;443
23.3;The SiteMapPath Control;445
23.3.1;Customizing the SiteMapPath;446
23.3.2;Using SiteMapPath Styles and Templates;447
23.3.3;Adding Custom Site Map Information;449
23.4;The TreeView Control;450
23.4.1;TreeView Properties;451
23.4.2;TreeView Styles;454
23.4.2.1;Applying Styles to Node Types;456
23.4.2.2;Applying Styles to Node Levels;456
23.5;The Menu Control;458
23.5.1;Menu Styles;460
23.5.2;Menu Templates;461
23.6;The Last Word;464
24;PART 4 Working with Data;465
25;CHAPTER 14 ADO.NET Fundamentals;466
25.1;Understanding Databases;466
25.2;Configuring Your Database;468
25.2.1;SQL Server Express;468
25.2.2;Browsing and Modifying Databases in Visual Studio;469
25.2.3;The sqlcmd Command-Line Tool;472
25.3;SQL Basics;473
25.3.1;Running Queries in Visual Studio;474
25.3.2;The Select Statement;476
25.3.2.1;A Sample Select Statement;476
25.3.2.2;Improving the Select Statement;476
25.3.2.3;An Alternative Select Statement;477
25.3.2.4;The Where Clause;477
25.3.2.5;String Matching with the Like Operator;477
25.3.2.6;Aggregate Queries;478
25.3.3;The SQL Update Statement;478
25.3.4;The SQL Insert Statement;480
25.3.5;The SQL Delete Statement;480
25.4;The Data Provider Model;481
25.5;Direct Data Access;482
25.5.1;Creating a Connection;484
25.5.1.1;The Connection String;484
25.5.1.2;Windows Authentication;485
25.5.1.3;User Instance Connections;486
25.5.1.4;Storing the Connection String;487
25.5.1.5;Making the Connection;488
25.5.2;The Select Command;490
25.5.3;The DataReader;491
25.5.4;Putting It All Together;491
25.5.4.1;Filling the List Box;493
25.5.4.2;Retrieving the Record;494
25.5.5;Updating Data;496
25.5.5.1;Displaying Values in Text Boxes;496
25.5.5.2;Adding a Record;498
25.5.5.3;Creating More Robust Commands;501
25.5.5.4;Updating a Record;503
25.5.5.5;Deleting a Record;504
25.6;Disconnected Data Access;506
25.6.1;Selecting Disconnected Data;507
25.6.2;Selecting Multiple Tables;508
25.6.3;Defining Relationships;510
25.7;The Last Word;513
26;CHAPTER 15 Data Binding;514
26.1;Introducing Data Binding;514
26.1.1;Types of ASP.NET Data Binding;515
26.1.1.1;Single-Value, or “Simple,” Data Binding;515
26.1.1.2;Repeated-Value, or “List,” Binding;515
26.1.2;How Data Binding Works;515
26.2;Single-Value Data Binding;516
26.2.1;A Simple Data Binding Example;516
26.2.2;Simple Data Binding with Properties;519
26.2.3;Problems with Single-Value Data Binding;521
26.2.4;Using Code Instead of Simple Data Binding;521
26.3;Repeated-Value Data Binding;522
26.3.1;Data Binding with Simple List Controls;522
26.3.2;A Simple List Binding Example;523
26.3.3;Strongly Typed Collections;524
26.3.4;Multiple Binding;525
26.3.5;Data Binding with a Dictionary Collection;527
26.3.6;Using the DataValueField Property;528
26.3.7;Data Binding with ADO.NET;529
26.3.8;Creating a Record Editor;531
26.4;Data Source Controls;536
26.4.1;The Page Life Cycle with Data Binding;538
26.4.2;The SqlDataSource;539
26.4.3;Selecting Records;540
26.4.3.1;How the Data Source Controls Work;541
26.4.4;Parameterized Commands;542
26.4.4.1;Other Types of Parameters;544
26.4.4.2;Setting Parameter Values in Code;546
26.4.5;Handling Errors;548
26.4.6;Updating Records;549
26.4.6.1;Strict Concurrency Checking;551
26.5;The Last Word;553
27;CHAPTER 16 The Data Controls;554
27.1;The GridView;554
27.1.1;Automatically Generating Columns;555
27.1.2;Defining Columns;557
27.1.2.1;Configuring Columns;558
27.1.2.2;Generating Columns with Visual Studio;559
27.2;Formatting the GridView;561
27.2.1;Formatting Fields;561
27.2.2;Using Styles;562
27.2.2.1;Configuring Styles with Visual Studio;565
27.2.3;Formatting-Specific Values;565
27.3;Selecting a GridView Row;567
27.3.1;Adding a Select Button;568
27.3.1.1;Using a Data Field As a Select Button;569
27.3.2;Using Selection to Create Master-Details Pages;569
27.4;Editing with the GridView;571
27.5;Sorting and Paging the GridView;574
27.5.1;Sorting;574
27.5.1.1;Sorting and Selecting;575
27.5.2;Paging;576
27.5.2.1;Paging and Selection;577
27.6;Using GridView Templates;578
27.6.1;Using Multiple Templates;580
27.6.2;Editing Templates in Visual Studio;581
27.6.3;Handling Events in a Template;582
27.6.4;Editing with a Template;583
27.6.4.1;Editing with Validation;585
27.6.4.2;Editing Without a Command Column;586
27.7;The DetailsView and FormView;588
27.7.1;The DetailsView;588
27.7.1.1;Defining Fields;589
27.7.2;The FormView;590
27.8;The Last Word;593
28;CHAPTER 17 Files and Streams;594
28.1;Files and Web Applications;594
28.2;File System Information;595
28.2.1;The Path Class;596
28.2.2;The Directory and File Classes;597
28.2.2.1;Dissecting the Code . . .;601
28.2.3;The DirectoryInfo and FileInfo Classes;602
28.2.4;The DriveInfo Class;604
28.2.5;A Sample File Browser;605
28.2.5.1;Dissecting the Code . . .;608
28.3;Reading and Writing with Streams;609
28.3.1;Text Files;609
28.3.2;Binary Files;611
28.3.3;Shortcuts for Reading and Writing Files;612
28.3.4;A Simple Guest Book;613
28.3.4.1;Dissecting the Code . . .;618
28.4;Allowing File Uploads;619
28.4.1;The FileUpload Control;619
28.4.1.1;Dissecting the Code . . .;621
28.5;The Last Word;622
29;CHAPTER 18 XML;623
29.1;XML Explained;623
29.1.1;Improving the List with XML;625
29.1.2;XML Basics;626
29.1.3;Attributes;627
29.1.4;Comments;628
29.2;The XML Classes;628
29.2.1;The XML TextWriter;629
29.2.1.1;Dissecting the Code . . .;630
29.2.2;The XML Text Reader;632
29.2.2.1;Dissecting the Code . . .;635
29.2.3;Working with XML Documents in Memory;636
29.2.3.1;Dissecting the Code . . .;640
29.2.4;Reading an XML Document;641
29.2.5;Searching an XML Document;643
29.3;XML Validation;644
29.3.1;XML Namespaces;645
29.3.1.1;Writing XML Content with Namespaces;647
29.3.2;XML Schema Definition;648
29.3.2.1;Dissecting the Code . . .;649
29.3.3;Validating an XML Document;649
29.4;XML Display and Transforms;652
29.4.1;The Xml Web Control;655
29.5;The Last Word;656
30;PART 5 Website Security;657
31;CHAPTER 19 Security Fundamentals;658
31.1;Understanding Security;658
31.1.1;Testing and Deploying Security Settings;659
31.2;Authentication and Authorization;660
31.3;Forms Authentication;660
31.3.1;Web.config Settings;662
31.3.2;Authorization Rules;662
31.3.2.1;Controlling Access to Specific Directories;664
31.3.2.2;Controlling Access to Specific Files;664
31.3.2.3;Controlling Access for Specific Users;665
31.3.3;The WAT;666
31.3.4;The Login Page;668
31.3.4.1;Retrieving the User’s Identity;671
31.3.4.2;Signing Out;672
31.3.4.3;Persistent Cookies;673
31.4;Windows Authentication;674
31.4.1;Web.config Settings;674
31.4.2;A Windows Authentication Test;677
31.5;The Last Word;678
32;CHAPTER 20 Membership;679
32.1;The Membership Data Store;679
32.1.1;Membership with SQL Server Express;681
32.1.2;Using the Full Version of SQL Server;683
32.1.3;Configuring the Membership Provider;686
32.1.4;Creating Users with the WAT;689
32.1.5;The Membership and MembershipUser Classes;692
32.1.6;Authentication with Membership;696
32.1.7;Disabled Accounts;697
32.2;The Security Controls;697
32.2.1;The Login Control;698
32.2.2;The CreateUserWizard Control;704
32.2.3;The PasswordRecovery Control;708
32.3;Role-Based Security;711
32.3.1;Creating and Assigning Roles;711
32.3.2;Restricting Access Based on Roles;715
32.3.3;The LoginView Control;715
32.4;The Last Word;717
33;CHAPTER 21 Profiles;718
33.1;Understanding Profiles;718
33.1.1;Profile Performance;719
33.1.2;How Profiles Store Data;719
33.2;Using the SqlProfileProvider;721
33.2.1;Enabling Authentication;721
33.2.2;Using SQL Server Express;722
33.2.3;Using the Full Version of SQL Server;722
33.2.4;The Profile Databases;724
33.2.5;Defining Profile Properties;725
33.2.6;Using Profile Properties;726
33.2.7;Profile Serialization;728
33.2.8;Profile Groups;730
33.2.9;Profiles and Custom Data Types;731
33.2.9.1;Dissecting the Code . . .;733
33.2.9.2;Custom Type Serialization;733
33.2.9.3;Automatic Saves;734
33.2.10;The Profile API;734
33.2.11;Anonymous Profiles;737
33.2.11.1;Migrating Anonymous Profiles;739
33.3;The Last Word;740
34;PART 6 Advanced ASP.NET;741
35;CHAPTER 22 Component-Based Programming;742
35.1;Why Use Components?;742
35.2;Component Jargon;743
35.2.1;Three-Tier Design;743
35.2.2;Encapsulation;745
35.2.3;Business Objects;745
35.2.4;Data Objects;745
35.2.5;Components and Classes;745
35.3;Creating a Component;746
35.3.1;Classes and Namespaces;747
35.3.2;Class Members;748
35.3.3;Adding a Reference to the Component;749
35.3.4;Using the Component;751
35.4;Properties and State;753
35.4.1;A Stateful Account Class;754
35.4.2;A Stateless AccountUtility Class;755
35.5;Data-Access Components;756
35.5.1;A Simple Data-Access Component;756
35.5.1.1;Dissecting the Code . . .;759
35.5.2;Using the Data-Access Component;760
35.5.2.1;Dissecting the Code . . .;762
35.5.3;Enhancing the Component with Error Handling;763
35.5.4;Enhancing the Component with Aggregate Information;764
35.6;The ObjectDataSource;765
35.6.1;Making Classes the ObjectDataSource Can Understand;765
35.6.2;Selecting Records;766
35.6.3;Using Method Parameters;766
35.6.4;Updating Records;767
35.7;The Last Word;770
36;CHAPTER 23 Caching;771
36.1;Understanding Caching;771
36.1.1;When to Use Caching;772
36.1.2;Caching in ASP.NET;773
36.2;Output Caching;773
36.2.1;Caching on the Client Side;775
36.2.2;Caching and the Query String;775
36.2.3;Caching with Specific Query String Parameters;776
36.2.4;A Multiple Caching Example;777
36.2.5;Fragment Caching;779
36.2.6;Cache Profiles;779
36.3;Data Caching;780
36.3.1;Adding Items to the Cache;780
36.3.2;A Simple Cache Test;782
36.3.3;Caching to Provide Multiple Views;783
36.3.4;Caching with the Data Source Controls;786
36.3.4.1;Caching with SqlDataSource;787
36.3.4.2;Caching with ObjectDataSource;790
36.4;Caching with Dependencies;791
36.4.1;File Dependencies;791
36.4.2;Cache Item Dependencies;792
36.4.3;SQL Server Cache Dependencies;793
36.4.3.1;Enabling the Service Broker;794
36.4.3.2;Initializing the Caching Service;795
36.4.3.3;Creating the Cache Dependency;795
36.5;The Last Word;796
37;CHAPTER 24 LINQ and the Entity Framework;797
37.1;Understanding LINQ;797
37.2;LINQ Basics;798
37.2.1;LINQ Expressions;801
37.2.1.1;Filtering and Sorting;804
37.3;The Entity Framework;805
37.3.1;Creating an Entity Data Model;806
37.3.2;The Data Model Diagram;809
37.3.3;Updating a Data Model;812
37.3.4;The Data Model Code;814
37.3.4.1;Entities;814
37.3.4.2;Contexts;815
37.3.5;Querying the Data Model;815
37.3.6;Handling Errors;816
37.3.7;Navigating Relationships;818
37.4;Getting More Advanced with the Entity Framework;821
37.4.1;Querying with LINQ to Entities;821
37.4.2;Controlling When Data is Loaded;824
37.4.3;Updates, Inserts, and Deletes;825
37.4.4;Managing Concurrency;828
37.5;The EntityDataSource;829
37.5.1;Displaying Data;829
37.5.2;Editing Data;834
37.6;The Last Word;834
38;CHAPTER 25 ASP.NET AJAX;835
38.1;Understanding Ajax;835
38.1.1;Ajax: The Good;836
38.1.2;Ajax: The Bad;836
38.1.3;The ASP.NET AJAX Toolkit;837
38.1.4;The ScriptManager;837
38.2;Partial Refreshes;839
38.2.1;A Simple UpdatePanel Test;840
38.2.2;Handling Errors;843
38.2.3;Conditional Updates;845
38.2.4;Triggers;846
38.3;Progress Notification;851
38.3.1;Showing a Simulated Progress Bar;851
38.3.2;Cancellation;853
38.4;Timed Refreshes;855
38.5;The ASP.NET AJAX Control Toolkit;857
38.5.1;Installing the ASP.NET AJAX Control Toolkit;857
38.5.2;The Accordion;860
38.5.3;The AutoCompleteExtender;863
38.5.4;Getting More Controls;866
38.6;The Last Word;871
39;CHAPTER 26 Deploying ASP.NET Applications;872
39.1;ASP.NET Applications and the Web Server;872
39.1.1;How Web Servers Work;872
39.1.2;The Virtual Directory;874
39.1.3;Web Application URLs;874
39.1.4;Web Farms;876
39.2;Internet Information Services (IIS);876
39.2.1;The Many Faces of IIS;876
39.2.2;Installing IIS in Windows 7 or Windows Vista;877
39.2.3;Installing IIS 7 in Windows Server 2008;878
39.3;Managing Websites with IIS Manager;880
39.3.1;Creating a Virtual Directory;881
39.3.2;Understanding Application Pools;883
39.3.3;The ASP.NET Account;885
39.3.3.1;Changing the ASP.NET Account;887
39.3.3.2;Giving the ASP.NET Account More Privileges;888
39.3.4;Configuring a Website;889
39.3.4.1;The ASP.NET Configuration Icons;889
39.3.4.2;The IIS Configuration Icons;891
39.3.4.3;The Management Configuration Icons;892
39.3.5;The Default Page;892
39.3.6;Custom Error Pages;893
39.3.7;The Machine Key;895
39.3.8;Windows Authentication;897
39.3.9;Confidentiality with SSL and Certificates;899
39.3.9.1;Creating a Certificate Request;900
39.3.9.2;Implementing SSL;901
39.4;Deploying a Simple Site;902
39.4.1;Web Applications and Components;903
39.4.2;Other Configuration Steps;903
39.4.3;Code Compilation;904
39.5;Deploying with Visual Studio;905
39.5.1;Creating a Virtual Directory for a New Project;905
39.5.2;Copying a Website;908
39.5.3;Publishing a Website;911
39.6;The Last Word;912
40;Index;913




