z01i621764.fm page 705 monday, october 3, 2005 2:04 pm ... · aspnet account; network service...

50
705 Index A <A> tag, 16–17, 135, 136. See also HtmlAnchor control Abandon method, 549 AbortTransaction event, 108 AboveNormal priority, 602 Absolute Expiration Date attribute, 596 abstraction layers, HTTP protocol and server-side, 9–10 AcceptChanges method, 334, 341 AcceptChangesDuringFill property, 321, 325 AcceptChangesDuringUpdate property, 321 AcceptTypes property, 531 access control lists (ACLs), 659 Access databases. See AccessDataSource control Access this computer from the network permission, 654 AccessDataSource control, 392–393 opening Access databases, 393 overview, 384, 392 updating Access databases, 393 accessibility check, Visual Studio .NET 2005, 49–50, 153 AccessibleHeaderText property, 435 AccessKey property, 145 accounts. See also process identity anonymous account impersonation, 653–654 changing default, for worker process, 652. See also ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider hosting identity, 566 ACLs (access control lists), 659 AcquireRequestState event, 505, 506 action attribute, 14 Active Server Pages (ASP), 3, 4, 6, xvii ActiveStep property, 251 ActiveStepIndex property, 251 ActiveViewChanged event, 252, 257 ActiveX Data Objects (ADO), 263, 264 adapter pattern, 30 Adapter property, 125 adaptive rendering development stack and, 21 server controls and, 125 Add method, 539, 549, 575, 594 <add> tag, 203–204 Add value, 329 AddCacheDependency method, 528 AddCacheItemDependencies method, 528 AddCacheItemDependency method, 528 Added state, 337 AddError method, 516 AddFileDependencies method, 528 AddFileDependency method, 528 AddHeader method, 528 AddNew method, 349 AddUsersToRole method, 688 AddUsersToRoles method, 688 AddUserToRole method, 688 AddUserToRoles method, 688 AddValidationCallback method, 631 AddWithKey value, 329 administration. See application administration administrative permissions, 65, 69 ADO (ActiveX Data Objects), 263, 264 ADO.NET 1.x. See also ADO.NET data containers; ADO.NET data providers distributed transactions, 312–313 local transactions, 308–310 ADO.NET 2.0, 275 ADO.NET data containers, 319–352. See also ADO.NET data providers data adapters. See data adapters as data-binding data sources, 354–355 DataRelation objects, 346–348 DataSet objects, 333–340 DataTable objects, 340–345 DataView objects, 348–351 memory-resident database model and classes of, 332–333 overview, 319, 351–352

Upload: others

Post on 22-May-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

705

Index

A<A> tag, 16–17, 135, 136. See also HtmlAnchor controlAbandon method, 549AbortTransaction event, 108AboveNormal priority, 602Absolute Expiration Date attribute, 596abstraction layers, HTTP protocol and server-side, 9–10AcceptChanges method, 334, 341AcceptChangesDuringFill property, 321, 325AcceptChangesDuringUpdate property, 321AcceptTypes property, 531access control lists (ACLs), 659Access databases. See AccessDataSource controlAccess this computer from the network permission,

654AccessDataSource control, 392–393

opening Access databases, 393overview, 384, 392updating Access databases, 393

accessibility check, Visual Studio .NET 2005, 49–50, 153

AccessibleHeaderText property, 435AccessKey property, 145accounts. See also process identity

anonymous account impersonation, 653–654changing default, for worker process, 652. See also

ASPNET account; NETWORK SERVICE accountencryption and, 286permissions. See permissionsSQLServer session-state provider hosting identity,

566ACLs (access control lists), 659AcquireRequestState event, 505, 506action attribute, 14Active Server Pages (ASP), 3, 4, 6, xviiActiveStep property, 251ActiveStepIndex property, 251ActiveViewChanged event, 252, 257ActiveX Data Objects (ADO), 263, 264adapter pattern, 30Adapter property, 125

adaptive renderingdevelopment stack and, 21server controls and, 125

Add method, 539, 549, 575, 594<add> tag, 203–204Add value, 329AddCacheDependency method, 528AddCacheItemDependencies method, 528AddCacheItemDependency method, 528Added state, 337AddError method, 516AddFileDependencies method, 528AddFileDependency method, 528AddHeader method, 528AddNew method, 349AddUsersToRole method, 688AddUsersToRoles method, 688AddUserToRole method, 688AddUserToRoles method, 688AddValidationCallback method, 631AddWithKey value, 329administration. See application administrationadministrative permissions, 65, 69ADO (ActiveX Data Objects), 263, 264ADO.NET 1.x. See also ADO.NET data containers;

ADO.NET data providersdistributed transactions, 312–313local transactions, 308–310

ADO.NET 2.0, 275ADO.NET data containers, 319–352. See also

ADO.NET data providersdata adapters. See data adaptersas data-binding data sources, 354–355DataRelation objects, 346–348DataSet objects, 333–340DataTable objects, 340–345DataView objects, 348–351memory-resident database model and classes of,

332–333overview, 319, 351–352

Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM

Microsoft Press
Note
Programming Microsoft® ASP.NET 2.0 Core Reference (ISBN 0-7356-2176-4) by Dino Esposito (Solid Quality Learning). Published by Microsoft Press. Copyright © 2006 by Dino Esposito.
Page 2: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

706

ADO.NET data providers, 263–318. See also ADO.NET data containers

command execution. See commands, ADO.NETcomponents, 265–266data source connections. See connections, data

sourcedatabase access technologies, 264database-agnostic pages and, 273–274enumerating installed, 272–273instantiating, 271–272interfaces, 266–267managed providers and, 265–268managed providers vs. OLE DB providers, 267–268.NET Framework data access infrastructure,

264–274.NET Framework supported, 268–271for ODBC, 271for OLE DB providers, 270for Oracle, 269–270overview, 263, 317–318provider factory model, 271–274for SQL Server, 268–269

AdRotator control, 155–156AggregateCacheDependency class, 611–612algorithms, GridView control paging, 446AllErrors property, 515AllKeys property, 539allowAnonymous attribute, 204AllowCustomPaging property, 414allowCustomSqlDatabase attribute, 554AllowDelete property, 348AllowEdit property, 348AllowNew property, 348AllowPaging property, 414, 428, 469AllowPartiallyTrustedCallers attribute, 658AllowRemoteConnection registry entry, 561AllowSorting property, 414, 428AlternatingItem item type, 416AlternatingItemStyle property, 414AlternatingItemTemplate property, 369, 441AlternatingRowStyle property, 429, 470anchor tag. See <A> tag; HtmlAnchor control

anomalies, global.asax file, 512–514anonymous users

anonymous account impersonation, 653–654migrating data for, 212user profiles and, 207–208

AnonymousID property, 531AnonymousIdentification module, 503AnonymousTemplate property, 696Any location type, 628, 629App_Browsers directory, 58App_Code directory, 54–55, 58, 58–59, 395App_Data directory, 58AppDomains, 24, 81, 592appearance properties

DetailsView control, 469–470GridView control, 430

AppendCacheExtension method, 631AppendCookie method, 528AppendDataBoundItems property, 361, 362, 363, 367AppendHeader method, 528AppendToLog method, 528App_GlobalResources directory, 58, 59–62AppId column, 564application administration

editing configuration files, 75–77overview, 72–77Visual Studio .NET 2005 and, 72–77Web Site Administration Tool and, 72–75

application deploymentCopy Web site feature and, 44site precompilation and, 69–72Visual Studio .NET 2005 and, 66–72XCopy deployment, 66–69

Application Name attribute, 281Application objects, 100Application property, 502, 515Application Root Folder permissions, 654Application scope, <object> tag, 511ApplicationInstance property, 515ApplicationName property, 676, 683, 689ApplicationPath property, 533

ADO.NET data providers

Z01I621764.fm Page 706 Monday, October 3, 2005 2:04 PM

Page 3: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

707

applicationsadministration of. See application administrationADO.NET managed providers vs. OLE DB providers

and integration of, 267application domains, 24, 81, 592application factory, 88–89configuration of, 25. See also configuration;

web.config filesdata caching. See Cache objects; cachingdeployment of. See application deploymentdevelopment of. See ASP.NET programming; Web

application developmentdirectories for, 57–58external, to authenticate users, 672–673global.asax file directives, 509–510initialization of. See HttpApplication classmultilanguage. See localizationrestarts, 80, 87, 90–91runtime environment and application services,

25–27. See also providers; runtime environmentto share Forms authentication cookies, 671–672state of. See HttpApplicationState objectsWeb Site Administration Tool (WSAT) and, 73,

74–75Applied XML with the .NET Framework, 379App_LocalResources directory, 58, 59–62ApplyAppPathModifier method, 528ApplyDefaultSort property, 348ApplyPagePersonalization method, 209ApplyStyle method, 147ApplyStyleSheetSkin method, 124, 178AppName column, 564<appSettings> section, configuration file, 74AppSettings:XXX expression, 381App_Themes directory, 58, 62–63App_WebReferences directory, 58, 62.asax file extension, 81.ascx file extension, 49, 81. See also user controls.ashx file extension, 81.asmx file extension, 81ASP (Active Server Pages), 3, 4, 6, xvii<asp> namespace, 17, 19AspCompat attribute, 94, 523–524<asp:Content> tags, 47

ASP.default_aspx class, 84–85, 86ASP.global.asax class, 89ASP.NET 1.x. See also ASP.NET 2.0; ASP.NET

programmingauthentication schema, 27–28configuration files, 97control base classes, 21cookieless sessions, 552custom membership provider, 684–685database cache dependencies, 618development of, 3, xviiIIS 6.0 process model and, 83inadequacies of cache dependencies, 610<meta> tag, 134page life cycle, 22rich pages in, 220–222role management, 688themes, 236, 243user controls, 23

ASP.NET 2.0, 97. See also ASP.NET 1.x; ASP.NET programming

adaptive rendering, 125AdRotator control, 156advantages of, 4, xviiapplication services, 25browser-sensitive rendering, 126–127cache dependencies, 599changes in view state, 581–585control adapter architecture, 21control state, 128cookieless Forms authentication, 669–670data-bound controls, 21enabling database cache dependencies in, 618–620<head> tag and, 18input focus, 128–129master and content pages, 23new features, 125–129page life cycle, 22page-output caching, 641–644protected directories, 57–63rich server controls, 21themeable controls, 127UseSubmitBehavior property, 114

ASP.NET 2.0

Z01I621764.fm Page 707 Monday, October 3, 2005 2:04 PM

Page 4: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

708

ASPNET account. See also accounts; process identitySQLServer session-state provider and, 566worker processes and, 24, 63

ASP.NET Development Center, 34ASP.NET programming

ADO.NET data containers. See ADO.NET data containers

ADO.NET data providers. See ADO.NET data providers

books about, xviicaching. See cachingcode samples, xxi. See also codeconfiguring SQL Server 2005 Express Edition,

xix–xxdata binding, 353, 411–412. See also data source

controls; data source-based data binding; data-binding expressions

data-bound grid controls, 413–414, 464–465. See also DataGrid control; GridView control

developers and this book about, xviiiemail and postal addresses for questions and

comments, xxiform-based. See formsHTTP request context. See HTTP request contextlanguages. See languages, programmingMicrosoft Press Technology Updates Web page, xxoverview, xvii–xxipages. See pagesprogramming model. See programming modelrecord-view controls, 467, 497–498. See also

DetailsView control; FormView controlrich pages, 219–220. See also master pages; themes;

user controls; visual inheritance; Wizard controlruntime environment. See runtime environmentsecurity. See securityserver controls. See server controlsstate management. See state managementsupport for this book about, xxisystem requirements, xviii–xixVisual Studio .NET 2005 Community Technical

Preview prelease software and, xxWeb application development history and, xvii–xviiiWeb application development in Visual Studio .NET

2005. See Visual Studio .NET 2005; Web application development

ASP.NET projects. See projectsASP.NET Starter Kits, 26

aspnet_compiler tool, 70–71aspnetdb.mdf database, 73, 203, 207, 214–215aspnet_isapi.dll, 24, 80–81, 83, 509aspnet_regiis.exe tool, 285aspnet_regsql.exe tool, 563ASP.NETWebAdminFiles directory, 72aspnet_wp.exe worker process, 24, 63, 81ASPState database, 563–565ASPStateTempApplications table, 564ASPStateTempSessions table, 564–565.aspx file extension, 11, 39, 42, 45, 84, 92, 93. See also

pagesassemblies

compilation and, 63. See also compilation; site precompilation

default, 96–97.NET reflection and, 67pages and, 79resource, 59–60

@Assembly directive, 91, 96–97Assistive Technology devices, 416AssociatedControlID property, 153Async attribute, 94, 281asynchronous ADO.NET commands, 303–307

nonblocking, 303–305nonblocking data-driven pages and, 307overview, 303pages and scenarios for, 305–307setting up, 303SqlCommand objects and, 296–297

asynchronous notifiers, 612, 616asynchronous pages, 110AttachDBFileName attribute, 281attacks, security, 648, 702AttributeCollection class, 131attributes

<add> tag, 203–204Cache objects, 596–597connection pooling, 288ConnectionString property, 281–282<forms> section authentication, 667–669HTML, 130–131@Master directive, 223–224@OutputCache directive, 625–626@Page directive, 92–96page directives and, 92<sessionState> section, 554–555

ASPNET account

Z01I621764.fm Page 708 Monday, October 3, 2005 2:04 PM

Page 5: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

709

Attributes collection, 18, 19, 131Attributes property, 130, 130–131, 145Authenticate event, 693Authenticate method, 666AuthenticateRequest event, 505, 506, 690AuthenticateUser method, 663–664authentication, 658–660

ChangePassword control and, 700file authorization and access control lists (ACLs),

659Forms authentication. See Forms authenticationhost identity and, 566Membership class and, 679–680overview, 657–660Passport authentication, 660provider example, 27–28providers and, 28–29session state and, 561Windows authentication, 658

authorizationfile, 659role management and, 686–687

AuthorizeRequest event, 505, 506Auto property, 253AutoDetect mode, 552AutoDetect value, 670AutoEventWireup attribute, 94AutoGenerateColumns property, 414, 428auto-generated columns, GridView control, 433AutoGenerateDeleteButton property, 428, 469AutoGenerateEditButton property, 428, 469AutoGenerateInsertButton property, 469AutoGenerateRows property, 469AutoGenerateSelectButton property, 428AutoPostBack property, 150, 362, 363.axd file extension, 93

BBackColor property, 145BackImageUrl property, 414, 430, 469base classes, providers and, 30, 31–32Base64 encoding, 670BaseCompareValidator class, 161BaseValidator class, 159, 161batch update, 330–332

command builders, 331–332commands, 322data conflicts and optimistic lock, 330–331

BeginExecuteNonQuery method, 295BeginExecuteReader method, 295BeginExecuteXmlReader method, 295BeginInit method, 341, 349BeginLoadData method, 341BeginRequest event, 505, 506BeginTransaction method, 276behavior properties

DetailsView control, 469GridView control, 428–429

behaviors, command, 300–301BelowNormal priority, 602Bin directory, 57, 58, 63, 80, 96BinaryRead method, 534BinaryWrite method, 529Bind method, 380, 496binding containers, server control, 123BindingContainer property, 121, 123blank session items, 570<body> tag, 17–18books, 275, xvii, xviiiBorderColor property, 145BorderStyle property, 145BorderWidth property, 145BottomPagerRow property, 430, 471bound fields, GridView control, 435BoundColumn column type, 419BoundField column type, 434breakpoints, 63–64. See also debugging.browser file extension, 125, 126, 229Browser property, 531, 532<browsercaps> section, configuration file, 229browsers. See also Internet Explorer; Netscape

Navigatoradaptive rendering and, 21, 125browser-sensitive rendering and, 126–127device-specific master pages and, 227–229enabling client validation, 170–171IDS, 228–229mobile browser capabilities, 532User-Agent HTTP header, 9Visual Studio .NET 2005 target schema validation,

50–51Buffer attribute, 94Buffer property, 524BufferOutput property, 524builds. See compilationBulletedList control, 366–368

BulletedList control

Z01I621764.fm Page 709 Monday, October 3, 2005 2:04 PM

Page 6: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

710

BulletImageUrl property, 367BulletStyle property, 367business classes, 58–59, 396button columns, DataGrid control, 422Button control, 114, 148, 149–150button controls, 149–150button fields, GridView control, 435–437button suffixes, Wizard control, 251<button> tag, 139ButtonColumn column type, 419ButtonField column type, 434ButtonImageUrl button suffix, 251ButtonText button suffix, 251ButtonType button suffix, 251

CC# language, 5cache dependencies

custom, 609–612page-output caching and database, 630SQL Server, 616–624tracking, 598–599XML, 612–617

Cache objects. See also cachingarchitecture of, 595caching vs. fetching, 604–605clearing content of, 608controlling data expiration, 602–603custom cache dependencies, 609–612defining item removal callbacks, 599–601deleting items from, 597–598enumerating items, 607HttpApplicationState objects and memory usage, 541inserting new items into, 596–597lifetime, visibility, and location of, 538memory usage statistics, 603methods, 594operations with, 596–603overview, 591–592Page class and, 100per-request caching, 609practical issues, 604–609properties, 593–594setting item priority, 602SQL Server cache dependencies, 616–624state objects and, 592–593synchronization and, 608–609

tracking item dependencies, 598–599wrapper, 605–606XML cache dependencies, 612–617

Cache property, 515, 525CacheControl property, 525CacheDependency class, 598–599, 610–611CacheDuration property, 391, 407CacheExpirationPolicy property, 391, 407CacheItemPriority enumeration, 602CacheItemRemovedReason enumeration, 597–598CacheKeyDependency property, 391, 408CacheProfile attribute, 625CacheRolesInCookie property, 689caching, 591–645

application data and page-output, 591, 644–645. See also Cache objects; page-output caching

DetailsView control, 480fetching vs, 604–605If-Modified-Since HTTP header and cache validation,

9ObjectDataSource control, 398–399SqlDataSource control, 391–392XmlDataSource control, 410

calculations. See computationsCalendar control, 156–157callbacks

Cache object item removal, 599–601custom session-state providers and expiration,

569–570for DetailsView control paging, 477for GridView control sorting and paging, 454Page class and, 101page scripting model and, 22server cache-validation, 632

Cancel method, 295, 301CancelButtonClick event, 252CancelButtonStyle property, 250CancelCommand event, 418CancelSelectOnNullParameter property, 388CanDelete property, 385CanInsert property, 385CanPage property, 385CanRetrieveTotalRowCount property, 385CanSort property, 385CanUpdate property, 385Caption property, 415, 430, 469CaptionAlign property, 415, 430, 469

BulletImageUrl property

Z01I621764.fm Page 710 Monday, October 3, 2005 2:04 PM

Page 7: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

711

cascading style sheet (CSS) files, 23, 239, 244–245. See also themes

CaseSensitive property, 333, 340Cassini, 40CausesValidation property, 140, 149CD-ROM requirements, xixCellPadding property, 363, 415, 430, 469CellSpacing property, 364, 415, 430, 470certificates, client, 650change notifications, cache dependencies and, 611ChangeDatabase method, 276ChangeMode method, 490ChangePassword control, 699–701

password change, 700–701user authentication, 700

ChangePassword method, 277–278, 682ChangePasswordQuestionAndAnswer method, 682Charset property, 525CheckBox control, 148, 151CheckBox fields, GridView control, 438CheckBoxField column type, 434CheckBoxList control, 363–365checksum functions, 618ChildColumns property, 346ChildKeyConstraints property, 346ChildRelations property, 340ChildTable property, 346Class Library projects, 55classes. See also types

ADO.NET data provider, 265–266ADO.NET data providers vs. OLE DB providers, 267App_Code directory and, 58–59code-behind. See code-behind classescollection. See collectionscomponent model and, 15. See also component

modelconnection string builder, 282–283creating sample shared, 55–57HTML server control, 129–130@Import directive and names for, 97–98memory-resident database model and, 332–333.NET Framework and, 15. See also .NET FrameworkPage. See Page classpartial, 48, 85–86proxy, 62server control. See Control classwriting helper, 54–55

classic ASP, xviiClassName attribute, 92, 223Clear method, 334, 341, 529, 539, 549, 575ClearContent method, 529ClearError method, 516, 518, 557ClearHeaders method, 529Client location type, 628, 629ClientCertificate property, 532ClientID property, 102, 121, 122ClientQueryString property, 102clients. See also servers

client certificates, 650client-side cache validation, 9client state, 6enabling client validation, 170–171HttpRequest object client data properties, 532–533HttpRequest object client input validation, 535HttpSessionState class and state client managers,

543–545multiple logical forms and client HTML forms,

179–180validation and, 164Visual Studio .NET 2005 client targets, 50–51

ClientScript property, 101, 107ClientScriptManager class, 104ClientTarget attribute, 95, 171ClientTarget property, 102ClientValidationFunction property, 163Clone method, 334, 341Close method, 87, 276, 298, 529CloseConnection parameter, 300CLR (common language runtime), 313code

application restarts and code-access security policy, 91

attack-resistant, 648, 702code-behind classes, 48

Visual Studio .NET 2005 page design features. See also code-behind classes

code-injection attacks, 648, 702code tip windows, 65companion content Web page and sample, xxicompilation. See compilationconfiguration files and, 57. See also configurationcreating sample shared class, 55–57defining event handlers, 53–54directory, 58–59

code

Z01I621764.fm Page 711 Monday, October 3, 2005 2:04 PM

Page 8: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

712

code, continuedediting. See code editor, Visual Studio .NET 2005global.asax file code declaration blocks, 510inline. See inline codeoverview, 53page code section and inline, 11page scripting and JavaScript, 22providers and reusability of, 30sample database, xix, xix–xxsample page, 12–14sandboxing, 658script-related Page class methods, 106–108source, 42, 58–59, 69–70Source view and, 45Visual Studio .NET 2005 and code refactoring,

51–52Visual Studio .NET 2005 projects and, 53–57. See

also projectsWeb applications and, 15writing helper classes, 54–55

code-behind classesconstraints of, 39dynamic compilation of, 42as partial classes, 86Visual Studio .NET 2005 and, 46, 48

code editor, Visual Studio .NET 2005special capabilities, 49–51toolbox and controls, 49

CodeBehind attribute, 93CodeFile attribute, 92, 223codeless paging, GridView control, 443–444codeless sorting, GridView control, 449–451CodePage attribute, 95CodePage property, 548collections

as data-binding data sources, 355–357HTML server control, 19user profiles and, 205

colon symbol (:), 123columns

ASPStateTempApplications table, 564ASPStateTempSessions table, 564–565data adapter column-mapping mechanism

data adapter, 327–328DataColumn objects, 333, 343DataGrid control. See columns, DataGrid controlGridView control. See columns, GridView control

columns, DataGrid controlbutton, 422data-bound, 420–421hyperlink, 421–422sorting, 425–426templated, 423types of, 419–420

columns, GridView controlauto-generated, 433bound fields, 435button fields, 435–437CheckBox fields, 438configuring, 433–435hyperlink fields, 437–438image fields, 439–441templated fields, 441–442

Columns property, 340, 415, 420, 430COM objects, 521–523command builder objects, 331–332command buttons, HtmlInputButton control,

139–140Command object, 266CommandArgument property, 149CommandBehavior enumeration, 300–301CommandBuilder object, 266CommandField column type, 434CommandName property, 149CommandRowStyle property, 470commands

ADO.NET. See commands, ADO.NETGridView control, 460–462HTTP request, 9submitting forms, 10–11

commands, ADO.NET, 293–317asynchronous commands, 303–307data readers, 297–302multiple active result sets, 315–317overview, 293SQL notifications and dependencies, 314–315SQL Server 2005-specific enhancements, 313–317SqlCommand class, 293–297support for CLR types, 313support for XML as native type, 314transactions and, 308–313

CommandText class, 295–296CommandText property, 294CommandTimeout property, 294

code-behind classes

Z01I621764.fm Page 712 Monday, October 3, 2005 2:04 PM

Page 9: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

713

CommandType property, 294, 294–295comments, email and postal addresses for, xxiCommit method, 309commit model, DataSet object, 337CommitTransaction event, 108common language runtime (CLR), 24, 83, 102, 313Community Technical Preview (CTP) prelease

software, Visual Studio .NET 2005, xxcompanion content Web page, xxiCompareValidator control, 160, 161, 162–163, 166compilation

App_Code directory and, 395global.asax file, 508–509master page compilation, 229–230projects and, 63site precompilation. See site precompilationVisual Studio .NET 2005 and, 42

CompilationMode attribute, 93CompilerOptions attribute, 93Complete property, 253CompletetRequest method, 504component model

ASP.NET programming model and, 15–20classes. See classesevent-driven programming over HTTP and, 7–8.NET Framework and, 15–16runat attribute and, 16–19server controls and, 19–20

computationsDataRelation object, 347DataTable object, 342–343

Compute method, 341, 342concurrent data access. See locks.config file extension, 81configuration

code and configuration files, 57. See also machine.config files; web.config files

connection pooling, 288editing web.config files, 75–77Forms authentication, 667–671GridView control columns, 433–435GridView control pagers, 446–448HTTP modules and, 25membership provider, 685–686ObjectDataSource control, 403–404predefined providers, 75profile providers, 213–214

providers and, 32runtime environment and, 25. See also runtime

environmentsession state, 554–555SQL Server 2005 Express Edition, xix–xxSqlDataSource control, 389–390SQLServer session-state provider, 562–563StateServer session-state provider, 560–561tracing, 198–199<trust> section permissions, 655–656Visual Studio .NET 2005 and, 39, 669Web application development and, 20Web Site Administration Tool (WSAT) and, 74–75XCopy deployment and, 68–69

conflict detection, SqlDataSource control, 390–391ConflictDetection property, 388connection classes, ADO.NET data provider, 266Connection HTTP header, 9Connection Lifetime attribute, 288Connection objects, 266connection pooling, 287–293

clearing connection pool, 292–293configuring, 288detecting connection leaks, 290–291getting and releasing objects, 288–290managing connection lifetime, 291–292overview, 287

connection properties, HttpRequest object, 533–534Connection property, 294Connection Reset attribute, 288connection string builder classes, 282–283connection strings, 280–287

configuring properties for, 281–282connection string builder classes, 282–283overview, 280protecting, 285–287session-state providers and, 563storing and retrieving, 283–285

Connection Timeout attribute, 281connections, data source, 274–293

accessing schema information, 278–280changing passwords, 277–278connection pooling, 287–293connection strings, 280–287overview, 274–275SqlConnection class, 275–280

connections

Z01I621764.fm Page 713 Monday, October 3, 2005 2:04 PM

Page 10: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

714

ConnectionString property, 275, 281–282, 388ConnectionStrings:XXX expression, 381ConnectionTimeout property, 275constraints

DataTable object, 344–345Visual Studio .NET 2005, 38–39

Constraints property, 340containers. See content pages; HTML container

controls; master pagescross-machine, 593server control binding containers, 123server control naming containers, 122–123

Content control, 226–227content pages, 225–229. See also master pages

attaching, to master pages, 227Content control and, 226–227device-specific master pages and, 227–229page prototyping and, 23processing, 229–233setting page titles and, 229Visual Studio .NET 2005 and, 46, 47–48

ContentEncoding property, 525, 531ContentLength property, 531ContentPlaceholder control, 224Contents property, 539, 548ContentType attribute, 95ContentType property, 525, 531context, HTTP. See HTTP request contextcontext properties, Page class, 102–103Context property, 502ContinueUpdateOnError property, 321Control attribute, 99Control class

events, 124–125interfaces, 120–121methods, 124properties, 121–124

@Control directive, 91, 92control skins. See skinscontrol state. See also state management

saving, 115server control, 128ServerChange event and detecting changes, 140–141view state and, 583–585

ControlAdapter class, 125ControlCollection class, 124ControlParameter type, 389

controlscategories of, 119–120control state. See control statedata-bound. See data-bound controlsdesign-time vs. run-time, 16dynamically created, 113generic, 17–18input focus and, 128–129mobile, 21Page class helper methods for, 105–106Page class rendering methods for, 103–104pages and, 20postbacks and detecting control state changes,

113–114server controls. See server controlsskins and, 23user controls. See user controlsVisual Studio .NET 2005 IntelliSense and, 44–45Visual Studio .NET 2005 toolbox and, 49XHTML and, 127

Controls collection, 158Controls property, 101, 121ControlStyle property, 145, 146–147ControlStyleCreated property, 145ControlToCompare property, 162ControlToValidate property, 161, 162ConvertNullToDBNull property, 394CookieDomain property, 665cookieless attribute, 554, 668, 670–671cookieless sessions, 551–554. See also cookies

creating, 551–552Forms authentication and, 669–670, 670–671issues with, 552–553security and, 553–554

CookieMode property, 548, 665cookieName attribute, 554CookieName property, 689CookieParameter type, 389CookiePath property, 689CookieProtectionValue property, 689CookieRequiredSSL property, 689cookies. See also cookieless sessions

Forms authentication and, 669as session IDs, 550–551shared Forms authentication, 671–672

Cookies property, 525, 532, 551CookieSlidingExpiration property, 689

ConnectionString property

Z01I621764.fm Page 714 Monday, October 3, 2005 2:04 PM

Page 11: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

715

CookiesSupported property, 666CookieTimeout property, 689Copy method, 334, 341Copy Web site feature, Visual Studio .NET 2005,

42–44, 66CopyBaseAttributes method, 147CopyFrom method, 147copying

applications. See application deploymentfiles, 66Web projects, 42–44

CopyTo method, 349, 549Count property, 348, 539, 548, 574, 593CreateCommand method, 271, 276CreateCommandBuilder method, 271CreateConnection method, 271Created column, 564CreateDataAdapter method, 271CreateDataReader method, 334, 341CreateNewStoreData method, 568CreateObject and CreateObjectFrom Clsid methods,

521–523CreateObject method, 518CreateObjectFromClsid method, 518CreateParameter method, 271, 295CreatePersistentCookie property, 689CreateRole method, 688, 690CreateSessionID method, 572CreateUninitialized method, 570CreateUninitializedItem method, 568CreateUser method, 678, 682CreateUserWizard control, 701credentials. See also authentication; authorization;

passwords; usernamesASP.NET 1.x validation of, 28login pages and, 662–663Membership class and managing, 681providers and, 33

cross-machine containers, 593cross-page postings, 22, 182–187. See also postbacks

detecting, 185posting data to other pages, 183–184@PreviousPageType directive and, 184redirection to other pages, 187@Reference directive vs., 99validation and, 185–186validation groups and, 172

cross-site scripting (XSS) attacks, 648, 702.cs file extension, 40, 42.csproj file extension, 81CSS (cascading style sheet) files, 23, 239, 244–245. See

also themesCssClass property, 146CssStyleCollection class, 146Culture attribute, 95Current Language attribute, 281Current property, 515, 606CurrentExecutionFilePath property, 531CurrentHandler property, 515CurrentMode property, 471CurrentPageIndex property, 415custom cache dependencies, 609–612

AggregateCacheDependency class and, 611–612CacheDependency class and, 610–611getting change notifications, 611inadequacies of ASP.NET 1.x, 610overview, 609–610SQL Server, 616–624XML, 612–617

custom controls, 119Custom mode, 544custom session-state providers, 568–571

default session-state providers, 568defining, 568–569locking, expiration, and, 569–570registering, 570–571replaying session data dictionary, 570

<customErrors> section, configuration file, 192–193customization

custom ASP.NET 1.x membership provider, 684–685

custom cache dependencies. See custom cache dependencies

custom error information, 170custom error pages, 193–194custom profile providers

profile providers, 215custom session ID generators, 571–573custom session-state providers. See custom session-

state providersdevelopment stack and custom controls, 21error pages and custom error messages, 192–193GridView control row, 463–464page-output caching and custom strings, 635–636

customization

Z01I621764.fm Page 715 Monday, October 3, 2005 2:04 PM

Page 12: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

716

customization, continuedprovider classes and, 34providers and runtime environment, 30themes. See customization themesuser profiles and custom types, 205

customization themes, 238, 240. See also themescustomProvider attribute, 554customProviderData attribute, 204CustomValidator control, 160, 163–164, 186

DDAL. See Data Access Layer (DAL)data. See also databases

ADO.NET. See ADO.NET data containers; ADO.NET data providers

caching. See Cache objects; cachingdata binding, 353, 411–412. See also data source

controls; data source-based data binding; data-binding expressions

data-bound controls. See data-bound controlsDetailsView control operations, 480–489migrating anonymous user, 212processing posted, 112record views. See DetailsView control; FormView

controlsession state data persistence. See data persistence,

session statesession-state data stores. See session-state providerstypes. See typesuser profiles and, 203–204, 204–205validation. See validationvisualizers, 65

Data Access Layer (DAL)business classes and, 396data access and, 274paging, 444–446sorting, 451–452

data adapters, 319–332batch update and, 330–332filling DataSet objects with, 323–324loading options, 324–326overview, 319–320SqlDataAdapter class, 320–326table-mapping mechanism, 326–330

data bindingDataGrid control, 419–423, 420–421DetailsView control, 473, 474–477FormView control, 491–494

GridView control. See data binding, GridView control

model, 353, 411–412. See also data source controls; data source-based data binding; data-binding expressions

data-binding expressions, 373–382Bind method, 380creating, 373–375DataBinder class, 376–378IExpressionsAccessor interface and, 121methods, 378–382runtime and implementation of, 375–376simple data binding, 373–376user-defined dynamic, 380–382XPath method, 379XPathSelect method, 379–380

data binding, GridView control, 432–442bound fields, 435button fields, 435–437CheckBox fields, 438configuring columns, 433–435empty data sources and auto-generated columns,

433hyperlink fields, 437–438image fields, 439–441simple, 432–433templated fields, 441–442

data-bound controlsASP.NET 2.0, 21data source controls interaction with, 385–386grid controls, 385–386, 413–414, 464–465. See also

DataGrid control; GridView controlHtmlSelect control, 136overview, 119

data dictionary, session, 570data persistence, session state

to remote servers, 557–561to SQL Server, 562–566

Data property, 408data readers, 297–302

accessing multiple result sets, 301–302closing, 301command behaviors, 300–301DataSet objects and, 335–336reading data with, 299–300SqlDataReader class properties and methods,

297–299Data Source attribute, 282

customization themes

Z01I621764.fm Page 716 Monday, October 3, 2005 2:04 PM

Page 13: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

717

data source-based data binding, 354–373feasible data sources, 354–357iterative controls, 368–373list controls, 362–368properties, 357–362

data source controls, 382–411AccessDataSource control, 392–393caching, 606DataGrid control and, 383DataSourceView class, 384–385GridView control and, 383–384hierarchical, 384HierarchicalDataSourceView class, 386interaction with data-bound controls, 385–386internals of, 384–386ObjectDataSource control, 393–404overview, 382–384SiteMapDataSource control, 404–407SqlDataSource control, 386–392tabular, 384XmlDataSource control, 407–411

data sourcesADO.NET classes, 354–355ADO.NET data providers and, 268collection-based classes, 355–357connections. See connections, data sourcedata source-based data binding. See data source-

based data bindingDataGrid control paging and, 424–425DataGrid control rows and, 417–418GridView control empty, 433

DataAdapter object, 266Database attribute, 281Database property, 275databases. See also data

Access, 392–393cache dependencies and, 616–624code samples and, xix, xix–xxcredentials and, 73–74memory-resident database model, 332–333Oracle, 269–270page-output caching and cache dependencies, 630SQL Server. See SQL ServerSQL Server session store, 563–565user profile, 206–207, 214–215XCopy deployment and, 68

DataBind method, 104, 124, 178, 374DataBinder class, 376–378

DataBinding event, 108, 124DataBindings property, 121DataBoundControl class, 156DataBoundLiteralControl class, 373DataColumn objects, 333, 343DataFile property, 408DataGrid control, 414–427. See also GridView control

binding data to, 419–423button columns, 422column types, 419–420constituent elements, 416–417data-bound columns, 420–421data source controls and, 383data source rows and displayed rows, 417–418editing rows, 426–427events, 418–419GridView control vs., 419hyperlink columns, 421–422as iterative control, 372–373object model, 414–419overview, 413–414, 464–465page interaction with, 423–427paging through data sources, 424–425properties, 414–416sorting columns of data, 425–426templated columns, 423view state and, 579

DataItem property, 471DataItemCount property, 471DataItemIndex property, 471DataKey property, 471DataKeyField property, 361–362, 415DataKeyNames property, 403, 431, 462, 471DataKeys property, 415, 431DataList control, 368, 370–372DataMember property, 359, 362, 364, 367, 369, 415,

428, 469DataNavigateUrlField property, 422DataNavigateUrlFormatString property, 422DataObjectTypeName property, 394, 458DataReader objects, 266DataRelation objects, 346–348

as container objects, 333creating, 346–347performing computations on, 347properties, 346serialization, 347–348

DataRow objects, 333, 344

DataRow objects

Z01I621764.fm Page 717 Monday, October 3, 2005 2:04 PM

Page 14: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

718

DataRowState enumeration, 337DataSet objects, 333–340

App_Code directory and, 59commit model, 337as container objects, 332, 333filling, with data adapters, 323–326merging, 336methods, 334–335properties, 333–334reading stored data, 335–336serialization and remoting format, 339–340serializing contents to XML, 337–339session state and, 559

DataSet property, 340, 346DataSetName property, 333DataSource property, 275, 357–358, 362, 364, 367,

369, 415, 428, 442, 469DataSourceID property, 358–359, 362, 364, 367, 369,

415, 428, 469DataSourceMode property, 388DataSourceView class, 384–385DataTable objects, 340–345

as container objects, 333DataColumn objects and, 343DataRow objects and, 344performing computations, 342–343properties and methods, 340–342table constraints, 344–345

DataTextField property, 359–360, 362, 364, 367DataTextFormatString property, 360, 362, 364, 367DataValueField property, 360–361, 362, 364, 367DataView objects, 348–351

as container objects, 333finding rows, 350–351methods, 349navigation, 349–350properties, 348–349

DataViewManager property, 348DbProviderFactory class, 271Debug attribute, 93Debug class, 197debugging

options, 196–197. See also tracingprojects, 63–65Web Site Administration Tool (WSAT) and, 74web.config files and, 63

declarative programming. See configurationDecode method, 572

Decrypt method, 666default account permissions, 654default data item retrieval, 378default error pages, 188–190default master pagecontent, 225default names, 48Default parameter, 300Default priority, 602default state providers, 568DefaultMode property, 469defaultUrl attribute, 668DefaultUrl property, 666defaultValue attribute, 204DefaultView property, 341DefaultViewManager property, 333Delete method, 349, 385DeleteCommand event, 418DeleteCommand property, 321, 387DeleteCommandType property, 387DeleteCookie method, 688Deleted state, 337DeleteItem method, 490DeleteMethod property, 394DeleteParameters property, 387, 394DeleteRole method, 689, 690deletes

Cache object, 597–598, 599–601DetailsView control, 482–484GridView control, 458–459ObjectDataSource control, 401–403

DeleteUser method, 678, 683denial of service (DoS) attacks, 648Deny logon locally permission, 654Deny Logon through Terminal Services permission,

654dependencies, ADO.NET SQL, 314–315. See also cache

dependenciesDependencies attribute, 596DependencyChanged removal reason, 598DependencyDispose method, 610deployment. See application deploymentDepth property, 297Description attribute, 94deserialization, StateServer session-state provider,

558–559. See also serializationdesign pattern, provider, 26–27design-time controls, 16Design view, Visual Studio .NET 2005, 45, 47, 53

DataRowState enumeration

Z01I621764.fm Page 718 Monday, October 3, 2005 2:04 PM

Page 15: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

719

DesignerInitialize method, 105DestinationPageUrl button suffix, 251Detached state, 337DetailsView control, 467–489. See also FormView

controlbinding data to, 474–477caching, 480controlling displayed fields, 475creating master/detail views, 477–480data manipulation, 480–489deleting records, 482–484drilling down into records, 477–479editing records, 480–481events, 472inserting records, 484–485overview, 467–468, 497–498paging, 475–477paging via callbacks, 477properties, 468–472simple data binding, 473templated fields, 485–486validation with validation controls, 486–488validation without validation controls, 488–489

developers, xviii. See also Web application development

development stack. See also Web application development

application services and, 25–26ASP.NET programming model and, 20–27component model and, 8page framework, 22–23presentation layer, 20–21runtime environment, 24–27

device-specific master pages, 227–229DictionaryEntry objects, 607DiffGram write mode, 338directives, page. See page directivesdirectories

application restarts and, 91code, 54configuration files and, 57default account permissions and, 654IIS virtual, 40–41, 67projects, 45protected. See protected directoriesweb.config files and, 25

Disabled property, 130disk files. See files

Display property, 161DisplayCancelButton property, 251DisplayExpression property, 341DisplayMode property, 367DisplaySideBar property, 251, 255Dispose method, 116, 124, 277, 504, 568Disposed event, 108, 116, 124, 505Distributed Transaction Coordinator (DTC), 308distributed transactions, ADO.NET

in ADO.NET 1.x, 312–313local transactions vs., 308with TransactionScope object, 311–312

$ (dollar symbol), 122, 123dollar symbol ($), 122domain attribute, 668, 672Domain Name System (DNS), 9Domain property, 689DoS (denial of service) attacks, 648Dotfuscator tool, 70DownStream location type, 628, 629DPAPIProtectedConfigurationProvider, 285drill down, DetailsView control, 477–479drop-down list boxes, HtmlSelect control, 136DropDownList control, 362–363Duration attribute, 625, 626–627DVD-ROM requirements, xixdynamic compilation, 79, 90dynamic data-binding expressions, 380–382dynamic expressions, 380–382Dynamic HTML, 160, 170dynamically changing master pages, 235–236dynamically created controls, 113dynamically loading themes, 246–247

Eeavesdropping attacks, 648edit template, FormView control, 494–495EditCommand event, 418EditCommandColumn column type, 419EditIndex property, 431editing

DataGrid control, 426–427DetailsView control, 480–481FormView control, 494–497GridView control. See editing, GridView controlVisual Studio .NET 2005, 44–45, 44–45. See also

code editor, Visual Studio .NET 2005

editing

Z01I621764.fm Page 719 Monday, October 3, 2005 2:04 PM

Page 16: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

720

editing, GridView control, 455–459deleting displayed records, 458–459in-place, and updates, 455–458inserting new records, 459

EditItem item type, 416EditItemIndex property, 415EditItemStyle property, 415EditItemTemplate property, 441EditItemTemplate template, 490EditRowStyle property, 429, 470email

error messages and, 191support addresses, xxi

empty data sources, GridView control, 433EmptyDataRowStyle property, 429, 470EmptyDataTemplate property, 430, 471EmptyDataText property, 430, 470EnableCaching property, 391, 408, 410EnableClientScript property, 161enableCrossAppRedirects attribute, 668EnableCrossAppRedirects property, 666Enabled property, 146, 161, 689EnablePaging property, 394EnablePagingCallbacks property, 469EnablePasswordReset property, 676, 683EnablePasswordRetrieval property, 677, 683EnableSessionState attribute, 94, 547EnableSortingAndPagingCallbacks property, 428EnableTheming property, 102, 121, 127, 243EnableViewState attribute, 94EnableViewState property, 102, 121, 581EnableViewStateMac attribute, 94EnableViewStateMac property, 102Encode method, 572Encrypt attribute, 281Encrypt method, 666encryption

connection strings and, 285–287providers, 285view state, 575–576

End method, 529EndExecuteNonQuery method, 295EndExecuteReader method, 295EndExecuteXmlReader method, 295EndInit method, 341, 349EndLoadData method, 341

EndRequest event, 505, 507EndRequest method, 568EnforceConstraints property, 333Enlist attribute, 288EnlistDistributedTransaction method, 277, 312–313EnlistTransaction method, 277Environment permission, 657Error event, 108, 190, 196, 505, 512–514error handling, 188–192

default error pages, 188–190global, 191overview, 188page-level, 190precedence, 196robust, 192

error pages, 192–197custom, 193–194custom error messages and, 192–193default, 188–190getting information about exceptions, 195–196handling common HTTP errors, 194–195robust error handling and, 192Web Site Administration Tool (WSAT) and, 75

Error property, 515Error value, 328, 329ErrorMessage property, 161, 167ErrorPage attribute, 94ErrorPage property, 101errors. See also exceptions

error handling. See error handlingerror pages. See error pagesHTTP. See HTTP errorspage. See page errorstracking global.asax file, 512–514

Eval method, 376–378, 493–494event-driven programming over HTTP, 6–8event handlers

application errors, 512–514defining, 53–54HtmlAnchor control and, 136transition, 254

eventing modelPage class, 109–110single form model and, 109–110view state and, 109

editing, GridView control

Z01I621764.fm Page 720 Monday, October 3, 2005 2:04 PM

Page 17: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

721

eventsControl class, 124–125DataGrid control, 418–419DataGrid control postback, 423–424DetailsView control, 472eventing model. See eventing modelGridView control, 431–432handling. See event handlersLogin control, 693–694LoginStatus control, 696LoginView control, 697Page class, 22, 108page finalization, 114–116page setup, 110–113personalization, 210–212postbacks, 113–114. See also postbackssession lifetime and, 556Wizard control, 252, 255–258

exceptions. See also errorsFormView control and unsupported function,

477–497HtmlException class, 175overview, 188unhandled. See unhandled exceptions

Execute method, 519, 519–521ExecuteNonQuery method, 295ExecuteReader method, 295ExecuteScalar method, 295ExecuteXmlReader method, 295execution flow, tracing, 197–199expiration

Cache object data, 602–603custom session-state providers and callbacks,

569–570Expired removal reason, 598Expires column, 564Expires property, 525ExpiresAbsolute property, 525Explicit attribute, 93, 94explicit localization, 61–62export and import of Visual Studio .NET 2005 IDE

features, 52–53, 52–53expression builders, 380–382ExpressionBuilder class, 382expressions, data-binding. See data-binding

expressions

expressions, regular, 702ExtendedProperties property, 333, 341, 346Extensible Stylesheet Language Transformations

(XSLT), 157, 410external application login pages, 672–673external pages, HttpServerUtility class and

embedding, 519–521

Ffactory classes, 271–272Failover Partner attribute, 281fetching vs. caching, 604–605FieldCount property, 297FieldHeaderStyle property, 470fields. See also properties

Cache class, 593–594code refactoring and, 51–52DetailsView control, 475, 485–486hidden. See hidden fieldsRequiredFieldValidator control and, 166

fields, GridView controlbound, 435button, 435–437CheckBox, 438hyperlink, 437–438image, 439–441templated, 441–442

Fields property, 471file authorization, 659File Transfer Protocol (FTP), 40, 41, 42, 66FileAuthorization module, 503FileAuthorizationModule module, 659FileIO permission, 656FilePath property, 531files

copying, 66file system path Web site access, 40–41HtmlInputFile control and uploading, 141–144HttpResponse objects and writing large, 530loading view state from Web server, 588–589saving requests in disk, 534–535saving view state to Web server, 587–588temporary, 68Visual Studio .NET 2005, 39

Files property, 532FileSystemWatcher objects, 616

FileSystemWatcher objects

Z01I621764.fm Page 721 Monday, October 3, 2005 2:04 PM

Page 18: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

722

FileUpload control, 148, 153–154Fill method, 322, 323–324fill operations, data adapter, 323–326FillLoadOption property, 321, 324FillSchema method, 322, 329–330filter expressions, parameters vs., 388Filter property, 525, 532FilterExpression property, 387, 394FilterParameters property, 387, 394Find method, 349FindControl method, 105, 124, 178FindRows method, 349FindUsersByEmail method, 678, 683FindUsersByName method, 678, 683FindUsersInRole method, 689, 690Finish property, 253FinishButtonClick event, 252, 258FinishCompleteButtonStyle property, 250FinishNavigationTemplate property, 250FinishPreviousButtonStyle property, 250Firefox browser, 228, 438FirstBulletNumber property, 367fixed identity impersonation, 652–653Flags column, 565Flush method, 529Focus method, 124, 178folders. See directoriesFont property, 146<font> tag, 17Footer item type, 417footer rows, FormView control, 491FooterRow property, 431, 471FooterStyle property, 415, 420, 429, 435, 470FooterTemplate property, 369, 441, 471FooterText property, 420, 435, 470ForeColor property, 146, 161ForeignKeyConstraint class, 344–345Form collection, 11Form property, 101, 532<form> tag, 6, 10, 13, 14, 22, 109, 175, 179–182. See

also HtmlForm classFormParameter type, 389forms, 175–217

ASP.NET tracing, 197–202cross-page postings and, 22, 182–188debugging options, 196–197

HtmlForm class, 176–178HTTP protocol and, 10–11multiple logical forms and, 178–182overview, 216–217page errors and. See page errorspage personalization with user profiles. See user

profilespages and, 175. See also pagessingle-form interface (SFI) model and, 176single form model and, 109–110

Forms authentication, 660–675authenticating users, 663–664collecting credentials through login, 662–663configuration, 667–671control flow, 661–665cookie-based, 669cookieless, in ASP.NET 2.0, 669–670external application login pages, 672–673<forms> section attributes, 667–669FormsAuthentication class, 665–667options for cookieless, 670–671overview, 660–661secured sockets and, 673–674security issues with, 674–675shared cookies, 671–672signing out, 664–665

<forms> section, configuration file, 667–669FormsAuthentication class, 665–667

methods, 666–667properties, 665–666

FormsAuthentication module, 503FormsCookieName property, 666FormsCookiePath property, 666FormView control, 489–497. See also DetailsView

controlBind method, 496binding data to, 491–494data display, 492–493edit template, 494–495editing data, 494–497Eval method, 493–494header, footer, and pager rows, 491insert template, 496InsertTemplate property, 442members, 489methods, 490–491

FileUpload control

Z01I621764.fm Page 722 Monday, October 3, 2005 2:04 PM

Page 19: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

723

object model, 489–491overview, 497–498templates, 490unsupported functions and, 477–497

FrontPage Server Extensions, 38FTP (File Transfer Protocol), 40, 41, 42, 66Full trust level, 655fully qualified class names, 97–98

GGAC (global assembly cache) permissions, 654GeneratePassword method, 678generic controls, 17–18, 130GET command, 9, 10Get method, 178, 539, 594GetAllRoles method, 689, 690GetAllUsers method, 678, 683GetAppConfig method, 516GetAuthCookie method, 666, 667GetBoolean method, 298GetByte method, 298GetBytes method, 298, 299GetCallbackEventReference method, 106GetChanges method, 334, 342GetChar method, 298GetChars method, 298GetConfig method, 516GetDataTypeName method, 298GetDateTime method, 298GetDecimal method, 298GetDouble method, 298GetEnumerator method, 349, 540, 549, 575, 594GetErrors method, 342GetFieldType method, 298GetFillParameters method, 322GetFloat method, 298GetGlobalResourceObject method, 516GetGuid method, 298GetHistory method, 251GetInt16 method, 298GetInt32 method, 298GetInt64 method, 298GetItem method, 568GetItemExclusive method, 569GetKey method, 540GetLastError method, 190, 194, 519

GetLocalResourceObject method, 516GetName method, 298GetNumberOfUsersOnline method, 678, 683GetOrdinal method, 298GetPassword method, 683GetPostBackClientEvent method, 106GetPostBackClientHyperlink method, 106GetPostBackEventReference method, 106GetRedirectUrl method, 666GetRolesForUser method, 689, 690GetSchema method, 277, 278–280GetSchemaTable method, 298GetSection method, 516GetSessionID method, 572GetString method, 298GetTypeHashCode method, 105GetUniqueID method, 610GetUser method, 678, 683GetUserNameByEmail method, 678, 683GetUsersInRole method, 689, 690GetValidators method, 105GetValue method, 298GetValues method, 298GetVaryByCustomString, 504GetWebResourceUrl method, 104GetXml method, 334GetXmlSchema method, 334global assembly cache (GAC) permissions, 654global error handling, 191global resources, localization and, 61–62global.asax file, 507–514

application directives, 509–510application restarts and, 91code declaration blocks, 510compiling, 79, 508–509editing, 80global error handling, 191HttpApplication object and, 89, 90overview, 507server-side includes, 511server-side <object> tags, 510–511static properties, 511–512syntax of, 509–512tracking errors and anomalies, 512–514

graphical DataGrid elements, 416–417grid pagers. See pager rows

grid pagers

Z01I621764.fm Page 723 Monday, October 3, 2005 2:04 PM

Page 20: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

724

GridLines property, 415, 430, 470GridView control, 427–464. See also DataGrid control

binding data to, 433–442bound fields, 435button fields, 435–437callbacks for paging and sorting, 454CheckBox fields, 438codeless paging, 443–444codeless sorting, 449–451configuring columns, 433–435configuring pagers, 446–448Data Access Layer (DAL) paging, 444–446Data Access Layer (DAL) sorting, 451–452data source controls and, 383–384DataGrid control vs., 419deleting displayed records, 458–459editing data, 455–459empty data sources and auto-generated columns,

433events, 431–432executing operations on one row, 460–462hyperlink fields, 437–438image fields, 439–441in-place editing and updates, 455–458inserting new records, 459object model, 428–433overview, 413–414, 464–465paging algorithms, 446paging data, 442–448properties, 428–431row customization, 463–464selecting one row, 462–463simple data binding, 432–433sorting data, 449–454SqlDataSource control vs. ObjectDataSource control

and, 454–455templated fields, 441–442user feedback on sorting, 452–453

<group> tag, 205grouping properties, user profiles and, 205–206groups, validation, 171–172

Hhandler factory objects, 89, 89–90Handler property, 515hardware requirements, xviii–xixHasChanges method, 334

HasControls method, 105, 124, 178HasErrors property, 333, 341HashPasswordForStoringInConfigFile method, 666HasRows method, 302HasRows property, 297<head> tag, 17, 18, 133–135Header item type, 417Header property, 101HeaderImageUrl property, 420, 435HeaderRow property, 431, 471headers

error messages and, 190FormView control, 491HtmlHead control and, 133–135HTTP request, 9HTTP response, 9page-output caching and, 635

Headers property, 532HeaderStyle property, 250, 415, 421, 429, 435, 470HeaderTemplate property, 250, 369, 441, 471HeaderText property, 251, 421, 435, 470Height property, 146help resources

ASP.NET Development Center, 34attack-resistant code resources, 702books. See bookscode samples, xxiemail and postal addresses for questions and

comments, xxiHTTP packet information, 8Microsoft Press Technology Updates Web page, xxfor this book, xxiW3C Markup Validation Service, 127

helper classesApp_Code directory, 58–59writing, 54–55

helper methods, Page class, 105–106hidden-field tampering attacks, 648hidden fields

page source code and, 14_PREVIOUSPAGE hidden field, 183state management and, 6–7view state, 112, 115

HiddenField control, 148, 153–154hierarchical data source controls, 384, 386, 406HierarchicalDataBoundControl class, 406HierarchicalDataSourceView class, 386

GridLines property

Z01I621764.fm Page 724 Monday, October 3, 2005 2:04 PM

Page 21: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

725

High priority, 602High trust level, 655, 656–657highlights, Visual Studio .NET 2005, 40–45HorizontalAlign property, 415, 430, 470hosting identity, SQLServer session-state provider, 566hostname command, xixhref attribute, 16–17HTML

application deployment and, 71attributes, 130–131. See also attributescomponent model and, 7–8container controls. See HTML container controlsDesign view, Source view, and, 45forms and multiple logical forms, 179–180. See also

forms; HtmlForm classHTML server controls. See HTML server controlsHTTP response, 10input controls. See HTML input controlsinput tags and server controls, 113markup code. See markup codepage source code, 14tags. See tagsVisual Studio .NET 2005 markup preservation, 50

HTML container controls, 132–138HtmlAnchor control and event handling, 136HtmlAnchor control and URL navigation, 135HtmlHead control and header information, 133–135HtmlSelect control and lists, 136HtmlTable control and tables, 136–137HtmlTextArea control and text boxes, 137–138overview, 131, 132–133

HTML input controls, 138–139CausesValidation property and controlling

validation, 140ControlToValidate property and associating

validation controls with, 162HtmlImage control and image display, 144HtmlInputButton control and command buttons,

139–140HtmlInputFile control and uploading files, 141–144overview, 131, 138–139ServerChange event and detecting control state

changes, 140–141HTML server controls, 129–144

classes and predefined, 129–130hierarchy of, 131–132HTML attributes and, 130–131

HTML container controls, 132–138HTML input controls, 138–139HtmlControl base class, 130HtmlImage control, 144overview, 129runat attribute and, 17as server controls, 19Web server controls vs., 20

HtmlAnchor control, 133, 135, 136HtmlButton control, 133, 139HtmlContainerControl class, 132, 176HtmlControl class, 130HtmlDecode method, 519HtmlEncode method, 519HtmlException class, 175HtmlForm class, 176–178

<form> tag and, 175methods, 178Page class and, 101properties, 176–178single-form interface (SFI) model, 109–110

HtmlForm control, 133HtmlGenericControl class, 17–18, 18–19, 19HtmlGenericControl control, 130, 133HtmlHead control, 133, 133–135HtmlImage control, 144HtmlInputButton control, 138, 139–140HtmlInputCheckBox control, 138, 140–141, 151HtmlInputControl class, 13, 138HtmlInputFile control, 138, 141–144HtmlInputHidden control, 139HtmlInputImage control, 139, 140HtmlInputPassword control, 139HtmlInputRadioButton control, 139, 151HtmlInputReset control, 139HtmlInputSubmit control, 139HtmlInputText control, 139HtmlLink control, 135HtmlMeta control, 134HtmlSelect control, 133, 136HtmlTable control, 133, 136–137, 154HtmlTableCell control, 133HtmlTableRow control, 133, 137HtmlTextArea control, 133, 137–138HTTP errors. See also error pages

getting information about, 195–196handling common, 194–195

HTTP errors

Z01I621764.fm Page 725 Monday, October 3, 2005 2:04 PM

Page 22: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

726

HTTP protocol, 8–11ASP.NET programming and, 5ASP.NET programming model and, 3, 8–11authorization HTTP handlers, 659building server-side abstraction layers, 9–10event-driven programming over, 6–8HTTP listeners, 83HTTP-only session cookie feature, 551HTTP pipeline, 86, 649. See also runtime

environmentHTTP request, 9, 22HTTP request context. See HTTP request contextHTTP response, 9–10runtime environment modules, 25submitting forms, 10–11Web Forms model and, 5–6

HTTP request context, 501–536, 501–536application initialization and HttpApplication class,

502–507global.asax file, 507–514HttpContext class, 514–517HttpRequest objects, 530–535HttpResponse objects, 524–530overview, 501, 535–536Server objects and HttpServerUtility class, 518–524submitting forms and, 11

HTTP runtime environment. See runtime environmentHTTP SessionStateModule module, 543–547HttpApplication class, 502–507

events, 504–507methods, 503–504Modules property and application modules, 503overview, 502processing requests and, 89properties, 502–503

HttpApplicationFactory object, 87, 88–89HttpApplicationState objects, 538–542

concurrent data access, locking and, 542lifetime, visibility, and location of, 538memory occupation and Cache objects, 541methods, 539–540Page class and, 100properties, 539state management objects and, 538–539state synchronization, 540–541tradeoffs of, 541–542

HttpCachePolicy class, 630–632methods, 631–632properties, 631server cache-validation callbacks, 632

HttpContext class, 514–517lifetime, visibility, and location of, 538loading resources programmatically, 517methods, 516–517overview, 514processing requests, 87properties, 515–516URL rewriting, 517

HttpCookie objects, 551HttpCookieMode enumeration, 551–552<httpHandlers> section, configuration file, 89HttpMethod property, 531HttpPostedFile objects, 142–144HttpRemotingHandlerFactory class, 90HttpRequest objects, 530–535

methods, 534–535Page class and, 100properties, 531–534

HttpResponse objects, 524–530methods, 528–530output caching features, 529–530overview, 524Page class and, 100properties, 524–527setting cache policy, 526setting response filter, 526–527writing large files, 530

HttpRuntime objects, 87–88HTTPS, 662, 675HttpServerUtility class, 518–524

AspCompat attribute and, 523–524creating late-bound COM objects, 521–523Execute method and embedding external pages,

519–521methods, 518–524Page class and, 100properties, 518Server objects and, 518Transfer method and server-side redirection, 521

HttpSessionState class, 542–549. See also session state management

creating objects, 545–546HTTP SessionStateModule module and, 543–547

HTTP protocol

Z01I621764.fm Page 726 Monday, October 3, 2005 2:04 PM

Page 23: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

727

lifetime, visibility, and location of, 538methods, 549overview, 542–543Page class and, 100properties, 548–549state client managers and, 543–545synchronizing session state access, 546–547

http.sys file, 83HyperLink control, 148, 150HyperLinkColumn column type, 419HyperLinkField column type, 434hyperlinks

DataGrid control columns, 421–422GridView control fields, 437–438

Hypertext Transfer Protocol. See HTTP protocol

IIButtonControl interface, 149–150, 182ICallbackContainer and ICallbackEventHandler

interfaces, 428ICollection interface, 355IComponent interface, 120IControlBuilderAccessor interface, 120IControlDesignerAccessor interface, 120ID property, 102, 121IDataAdapter interface, 266IDataBindingsAccessor interface, 120IDataParameter interface, 266IDataReader interface, 266IDataSource interface, 407IDbCommand interface, 266, 293IDbConnection interface, 266IDbDataAdapter interface, 266IDbTransaction interface, 266IDE, Visual Studio .NET 2005. See also Visual Studio

.NET 2005constraints of, 39import and export of features, 52–53

IDictionary interface,, 355IDisposable interface, 120, 277IDs

browser, 126, 228–229component model and, 15, 16server control, 122session. See session IDs

IE browser ID, 228IEditableTextControl interface, 152

IEnumerable interface, 358IEWatch 2.0 tool, 675IExpressionsAccessor interface, 121If-Modified-Since header, HTTP, 9<iframe> tag, 17Ignore value, 328, 329IgnoreSchema write mode, 338IHierarchicalDataSource interface, 407IHTTPAsyncHandler interface, 110, 307IHttpHandler interface, 86, 90, 99IHttpHandlerFactory interface, 89IIS. See Internet Information Services (IIS)IList interface, 355Image control, 148, 150–151image fields, GridView control, 439–441ImageButton control, 148, 149–150, 150–151ImageField column type, 434ImageMap control, 148, 150–151images

deploying files, 71HtmlImage control and displaying, 144image button controls and, 150–151themes and files, 239

ImageUrl property, 150<img> tag, 144impersonation

anonymous account, 653–654fixed identity, 652–653

@Implements directive, 91, 98implicit localization, 60–62import and export of Visual Studio .NET 2005 IDE

features, 52–53@Import directive, 91, 97–98ImportRow method, 342in-place editing, GridView control, 455–458in-place error information, 169in-place site precompilation, 70INamingContainer interface, 99, 100include files, ASP, 221includes, global.asax file server-side, 511indentation, Visual Studio .NET 2005, 50inetinfo.exe, 83InferXmlSchema method, 334inheritance, visual, 221–222Inherits attribute, 93, 223Init event, 102, 108, 111, 125, 210Init method, 504

Init method

Z01I621764.fm Page 727 Monday, October 3, 2005 2:04 PM

Page 24: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

728

InitComplete event, 108, 111Initial Catalog attribute, 281Initial File Name attribute, 281initialization, application. See HttpApplication classInitialize method, 31, 32, 569, 572, 666InitializeRequest method, 569, 572injection attacks, 648, 702inline code, 11, 12–13, 48. See also codeInnerHtml property, 19InnerText property, 18, 19InProc mode, 544InProc state provider, 568InProcSessionStateStore class, 568input controls, HTML. See HTML input controlsinput focus, server control, 128–129input steps, WizardStep object, 253–254<input> tag, 14, 20, 138, 139input text class, 13InputStream property, 533Insert method, 385, 594insert template, FormView control, 496InsertCommand property, 321, 387InsertCommandType property, 387InsertInvisible property, 435InsertItem method, 490InsertItemTemplate template, 490InsertMethod property, 394InsertParameters property, 387, 394InsertRowStyle property, 470inserts

Cache object items, 596–597DetailsView control, 484–485GridView control, 459

InsertTemplate property, 442Integrated Security attribute, 281IntelliSense, Visual Studio .NET 2005, 39, 44–45interfaces

ADO.NET data provider, 266–267Control class, 120–121, 120–121data adapter, 320@Implements directive and, 98providers and, 30, 31–32

internationalization. See localizationInternet Explorer

browser ID, 228hyperlink fields and, 438IEWatch 2.0 tool, 675

<meta> tag, 134testing localization with, 61Visual Studio .NET 2005 and, 51

Internet Information Services (IIS)IIS 5.0 process model and, 81–82IIS 6.0 kernel caching

page-output caching and, 627–628IIS 6.0 process model and, 82–84lack of dependency of Visual Studio .NET 2005 on,

40memory limits, 641process models and, 24system requirements and, 5, xviiithread security context, 649, 649–650visual configuration editor, 75–77Visual Studio .NET 2005 constraints and, 38–56

Internet Server Application Programming Interface. See ISAPI extensions; ISAPI filter

intrinsic objects, Page class, 100–101IPageHeader interface, 101, 133IParserAccessor interface, 121IPostBackDataHandler interface, 112, 113, 138, 141IPostBackEventHandler interface, 114IPrincipal objects, 100ISAPI extensions

ASP, 4ASP.NET, 24as runtime environment modules, 80–81server-side abstraction layers and, 10

ISAPI filter, 58IsAsync property, 101IsAuthenticated property, 533IsCallback property, 101, 111IsClientConnected property, 525IsClientScriptBlockRegistered method, 107IsClosed property, 297IsCookieless property, 548IsCrossPagePostBack property, 101, 111, 185IsCustomErrorEnabled property, 515IsDbNull method, 298IsDebuggingEnabled property, 515IsEnabled property, 199IsItemDirty method, 575IsLocal property, 533IsNewSession property, 548IsolatedStorage permission, 656isolation levels, 309–310

InitComplete event

Z01I621764.fm Page 728 Monday, October 3, 2005 2:04 PM

Page 25: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

729

IsPostBack property, 101, 111, 112, 185IsReadOnly property, 548IsRequestBeingRedirected property, 525IsReusable property, 86IsSecureConnection property, 533IsStartupScriptRegistered method, 107IsSynchronized property, 548IsUserInRole method, 689, 690IsValid property, 101, 159, 161Item item type, 417Item property, 297, 349, 539, 548, 574, 593ItemCommand event, 418, 472ItemCreated event, 418, 472ItemDataBound event, 418ItemDeleted event, 472ItemDeleting event, 472ItemInserted event, 472ItemInserting event, 472Items property, 362, 364, 367, 369, 415, 515ItemStyle property, 415, 421, 435ItemTemplate property, 369, 441ItemTemplate template, 490ItemUpdated event, 472ItemUpdating event, 472iterative controls

data source-based data binding, 368–373DataGrid control, 372–373DataList control, 370–372overview, 368Repeater control, 368–370

ITextControl interface, 152ITransaction interface, 312IUrlResolutionService interface, 121IValidator interface, 160

JJ# language, 5Java 2 Enterprise Edition (J2EE), 4Java language, 4Java Server Pages (JSP), 4JavaBeans, 4JavaScript code, 22, 107–108JScript .NET, 5JSP (Java Server Pages), 4

Kkernel caching, page-output caching and, 627–628Key attribute, 596KeyInfo parameter, 300Keys property, 548, 574keywords. See also attributes

connection pooling, 288SQL Server connection string, 281–282

LLabel control, 148, 152–153LAMP platform, 4Language attribute, 93languages, foreign. See localizationlanguages, programming

ASP.NET programming, 5, 54directories and, 59JavaScript, 22, 107–108Web application development, 4

large files, HttpResponse objects and, 530late-bound COM objects, 521–523layout, page, 11, 13LCID attribute, 95LCID property, 548leaks, connection, 290–291life cycle, page

events and, 22, 108overview, 79, 110page finalization, 114–116page setup, 110–113postbacks, 113–114request processing and, 86

lifetimeconnection, 291–292session, 555–557state management objects, 538

LinkButton control, 148, 149–150list boxes, HtmlSelect control, 136list controls

BulletedList control, 366–368CheckBoxList control, 363–365data source-based data binding, 362–368DropDownList control, 362–363ListBox control, 366RadioButtonList control, 365–366

list controls

Z01I621764.fm Page 729 Monday, October 3, 2005 2:04 PM

Page 26: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

730

ListBox control, 366listeners, 83, 197Literal control, 152–153literal controls, 144, 152–153LiteralControl objects, 144Load event, 108, 112, 125LoadBalanceTimeout property, 292LoadComplete event, 108, 114LoadControl method, 105, 106LoadDataRow method, 342loading options, data adapter, 324–326LoadOptions enumeration, 324LoadPageStateFromPersistenceMedium method, 115LoadPostData method, 112LoadTemplate method, 105, 106LoadViewState method, 112local resources, localization and, 60–62local transactions, ADO.NET

in ADO.NET 1.x, 308–310distributed transactions vs., 308

local Web servertesting and, 65Visual Studio .NET 2005, 40

Locale property, 333, 341localization

attributes, 96local resource files and, 60–62

Location attribute, 625<location> section, configuration file, 68–69locations

page-output caching, 628–630state management objects, 538

Lock method, 540LockCookie column, 565LockDate column, 565LockDateLocal column, 565Locked column, 565locks

batch update optimistic, 330–331Cache object, 609custom session-state providers and, 569–570HttpApplicationState objects and, 542

Log on as a batch job permission, 654Log on as a service permission, 654

LoggedIn event, 693LoggedInTemplate property, 696LoggingIn event, 693logical forms, 178–182

multiple client HTML forms and, 179–180multiple server-side forms and, 180–182MultiView and Wizard controls and, 182

Login control, 691–694events, 693–694programming interface, 693setup, 692–693

login pagesASP.NET 1.x, 28external application, 672–673Forms authentication and, 661–662, 662–663Login control, 691–694LoginName control, 694LoginStatus control, 694–696LoginView control, 696–698

login templates, LoginView control, 697–698LoginError event, 693LoginImageUrl property, 696LoginName control, 694LoginStatus control, 694–696

events, 696properties, 695–696setup, 694–695

LoginText property, 696loginUrl attribute, 668LoginUrl property, 666LoginView control, 696–698

events, 697login templates, 697properties, 696role-based login templates, 697–698

LogonUserIdentity property, 533LogoutAction property, 696LogoutImageUrl property, 696LogoutPageUrl property, 696LogoutText property, 696LosFormatter class, 583, 586Low priority, 602Low trust level, 656, 656–657

ListBox control

Z01I621764.fm Page 730 Monday, October 3, 2005 2:04 PM

Page 27: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

731

MMachine Authentication Check, view state and, 576machine-level constraints, Visual Studio .NET 2005,

38–39machine.config files. See also configuration

application deployment and, 68–69application restarts and, 91assemblies, 96–97authentication settings, 669HTTP modules and, 25process models and, 81, 82, 84system parameters and, 25web.config files and, 57. See also web.config files

MaintainScrollPositionOnPostback property, 103managed providers. See ADO.NET data providersMapImageCoordinates method, 534MapPath method, 105, 519, 534Mapped value, 330markup code. See also code; HTML

applications and, 15Page class methods, 103–104page finalization and generating, 116placeholders, 13Visual Studio .NET 2005 markup preservation, 50

master/detail views, DetailsView control, 477–480caching, 480drilling down into records, 477–479

@Master directive, 91, 92, 223–224master pages, 222–236. See also content pages

attaching content pages to, 227compiling, 229–230content pages, Content control, and, 226–227ContentPlaceholder controls and, 224definition of, 222–223device-specific, 227–229dynamically changing, 235–236exposing properties of, 233–234invoking properties on, 234@Master directive and, 223–224@MasterType directive, 235nested, 231–233page prototyping and, 23processing content pages and, 229–233programming, 233–236rich pages and, 219serving, to users, 230setting page titles, 229

specifying default content, 225Visual Studio .NET 2005 and, 46, 46–47writing, 222–225writing content pages for, 225–229

Master property, 101, 236MasterPageFile attribute, 93, 223, 235–236MasterPageFile property, 101@MasterType directive, 235Max Pool Size attribute, 288MaxCachedResults property, 689MaximumRowsParameterName property, 394MaxInvalidPasswordAttempts property, 677, 683Medium trust level, 655, 656–657membership, 675–691

CreateUserWizard control, 701managing usernames and passwords, 681Membership class, 676–681membership providers and MembershipProvider

class, 682–686ProviderBase class, 682providers and, 27–29role management and, 675–676, 686–691. See also

role managementsetup, 678–679validating users, 679–680Web Site Administration Tool (WSAT) and, 73–74

Membership class, 676–681managing usernames and passwords, 681methods, 678properties, 676–678providers and, 29setting membership support, 678–679ValidateUser method, 679–680

membership providers, 682–686configuring, 685–686custom ASP.NET 1.x, 684–685extending interfaces of, 684ProviderBase and MembershipProvider classes,

682–684MembershipProvider class, 34, 682–686

creating custom ASP.NET 1.x provider, 684–685extending, 684methods, 682–683properties, 683–684provider configuration, 685–686ProviderBase class and, 682

MembershipProvider class

Z01I621764.fm Page 731 Monday, October 3, 2005 2:04 PM

Page 28: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

732

memoryapplication restarts and, 90Cache object statistics, 603HttpApplicationState objects, 541memory-resident database model, 332–333page-output caching and, 641

Merge method, 334merges, DataSet object, 336MergeStyle method, 147MergeWith method, 147messages

error, 167–168, 190, 192trace, 199–201

<meta> tag, 134metabase, IIS, 83–84Method property, 178methods

Cache objects, 594CacheDependency class, 610–611CommandText class, 295–296component model and, 15Control class, 124data adapter, 322–323data-binding expressions, 378–382DataSet object, 334–335DataSourceView class, 385DataTable object, 340–342DataView object, 349factory classes, 271–272FormsAuthentication class, 666–667FormView control, 490–491HtmlForm class, 178HttpApplicationState object, 539–540HttpCachePolicy class, 631–632HttpContext class, 516–517HttpRequest objects, 534–535HttpResponse object, 528–530HttpServerUtility class, 518–524HttpSessionState class, 549ISessionIDManager interface, 571–572Membership class, 678MembershipProvider class, 682–683Page class. See methods, Page classRoleProvider class, 690–691Roles class, 688–689SessionStateStoreProviderBase class, 568–569

SqlCommand class, 295–296SqlConnection class, 276–277SqlDataReader class, 298–299StateBag class, 575WebControl class, 147Wizard control, 251–252, 251–252

methods, Page class, 103–108controls-related methods, 105–106rendering methods, 103–104script-related methods, 106–108

Microsoft Access databases. See AccessDataSource control

Microsoft ASP.NET. See ASP.NET 1.x; ASP.NET 2.0; ASP.NET programming

Microsoft ASP.NET 2.0 Step by Step, xviiiMicrosoft Data Access Components (MDAC) 2.7, 5Microsoft Deveopers Network (MSDN), 702Microsoft FrontPage Server Extensions, 38, 40Microsoft Internet Explorer. See Internet ExplorerMicrosoft Internet Information Services. See Internet

Information Services (IIS)Microsoft JScript .NET, 5Microsoft Knowledge Base articles, xx, xxiMicrosoft Management Console (MMC), 75–77Microsoft Mouse, xixMicrosoft .NET Framework. See .NET FrameworkMicrosoft Press support, xx–xxiMicrosoft Press Technology Updates Web page, xxMicrosoft SQL Server. See SQL Server; SQL Server

2005; SQL Server 2005 Express EditionMicrosoft Visual Basic .NET, 5, 290Microsoft Visual Basic Scripting Edition (VBScript),

108Microsoft Visual Studio .NET 2005. See Visual Studio

.NET 2005Microsoft Windows

Windows 2000, 5, xviiiWindows Server 2003, 5, 82, xviiiWindows XP, 5, xviii

Microsoft.Jet.OLEDB.40 provider, 270MigrateAnonymous event, 212MIME (Multipurpose Internet Mail Extensions) types,

10Min Pool Size attribute, 288Minimal trust level, 656, 656–657MinimumCapacity property, 341

memory

Z01I621764.fm Page 732 Monday, October 3, 2005 2:04 PM

Page 29: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

733

MinRequiredNonAlphanumericCharacters property, 677, 683

MinRequiredPasswordLength property, 677, 683missing mapping actions, data adapter, 328missing schema actions, data adapter, 329MissingMappingAction enumeration, 328MissingMappingAction property, 321, 328MissingSchemaAction enumeration, 329MissingSchemaAction property, 321, 329mobile controls, 21, 119MobileCapabilities class, 532MobileControl and MobilePage classes, 21mode attribute, 554Mode property, 548ModeChanged event, 472ModeChanging event, 472modes, grid pager, 446–447Modified state, 337modules

application, 503ISAPI extensions as. See ISAPI extensions

Modules property, 502mouse requirements, xixMoveTo method, 251–252Mozilla browser, 228, 438Mscorlib.dll, 96MSDAORA provider, 270.msi file extension, 67multilanguage applications. See localizationmultiline text boxes, HtmlTextArea control, 137–138multiple ADO.NET result sets, 301–302, 315–317multiple logical forms. See logical formsMultipleActiveResultSets attribute, 281Multipurpose Internet Mail Extensions (MIME) types,

10MultiView control, 148, 158–159, 182. See also View

control

NName attribute, 97, 204name attribute, 668Name property, 138, 385named parameters, 296names

code-behind classes, 48computer, xixdirectories, 58

@Import directive and, 97–98pages and classes, 84resource files, 60

Namespace property, 334, 341namespaces

linking, 97–98managed data providers and, 268unknown tags and, 18

naming containersPage class, 99server control, 122–123

NamingContainer property, 101, 122navigation

DataView object, 349–350HtmlAnchor control and URL, 135

navigation, Wizard control, 255–258canceling navigation events, 257filtering navigation with events, 255–257finalizing wizard, 258

NavigationButtonStyle property, 250, 255NavigationStyle property, 250nested master pages, 231–233Nested property, 346Net attribute, 281.NET Framework

ASP.NET and, 3, 5component model and, 15–16root folder permissions, 654this book and, xvii

Netscape Navigator, 50, 51, 228Netscape3 browser ID, 228Netscape4 browser ID, 228Netscape6to9 browser ID, 228Network Library attribute, 281NETWORK SERVICE account. See also accounts;

process identityencryption and, 286SQLServer session-state provider and, 566worker processes and, 63

NewRow method, 342NextButtonClick event, 252, 255NextPrevious mode, 447NextPreviousFirstLast mode, 447NextResult method, 298NoAbsoluteExpiration property, 593nonblocking ADO.NET asynchronous commands,

303–305

nonblocking ADO.NET asynchronous commands

Z01I621764.fm Page 733 Monday, October 3, 2005 2:04 PM

Page 30: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

734

nonblocking ADO.NET asynchronous data-driven pages, 307

None location type, 628, 630Normal priority, 602Northwind database, xix, xix–xxNoSlidingExpiration property, 593NoStore attribute, 625Notification property, 294NotificationAutoEnlist property, 294notifications and dependencies, ADO.NET SQL,

314–315notifiers, asynchronous, 612, 616NotifyDependencyChanged method, 610NotRemovable priority, 602NotSupportedException exception, 477–497novice developers, xviiiNTFS permissions, 659Numeric mode, 447NumericFirstLast mode, 447

Oobfuscation strategy, 70object model. See also classes; methods; properties

DataGrid control, 414–419FormView control, 489–491GridView control, 428–433

<object> tags, global.asax file server-side, 510–511ObjectDataSource control, 384, 393–404

cache dependencies and, 622caching data and object instances, 398–399configuring parameters at run time, 403–404implementing data retrieval, 395–397paging support, 399–400programming interface, 394–395SelectParameters collection and adding parameters,

397–398SqlDataSource control vs., 454–455, 477updating and deleting data, 401–403

objects. See also classesconnection pooling, 288–290intrinsic Page class, 100–101

ObjectStateFormatter class, 583, 586–587ODBC data sources, 264, 268, 317Off mode, 544OldValuesParameterFormatString property, 388, 394

OLE DB providersas data sources, 264, 268, 317tested, 270

one-click attacks, 102, 648OnInit method, 111onserverclick attribute, 136OnServerClick event, 13Open Database Connectivity. See ODBC data sourcesOpen method, 277Openwave-powered devices, 228Opera browser ID, 228operating system requirements, 5, xviii. See also

Microsoft WindowsOperator property, 163optimistic lock, batch update, 330–331Oracle data source, 268, 269–270originUrl attribute, 656out-of-process session-state providers. See SQLServer

session-state provider; StateServer session-state provider

OutOfProcSessionStateStore class, 568output filters, HttpResponse object, 526–527Output property, 525@OutputCache directive, 625–630

attributes, 625–626database dependencies and, 630IIS 6.0 kernel caching and, 627–628locations, 628–630pages and, 91user controls and. See user controls

OutputCache module, 503OutputCacheLocation enumeration, 628OutputStream property, 525OverwriteChanges value, 324

PPacket Size attribute, 281packets, HTTP, 8. See also HTTP protocolPacketSize property, 276Page attribute, 99page behavior attributes, 94–95Page class. See also pages

compilation, 79context properties, 102–103controls-related methods, 105–106

nonblocking ADO.NET asynchronous data-driven pages

Z01I621764.fm Page 734 Monday, October 3, 2005 2:04 PM

Page 31: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

735

eventing model, 109–110events, 108<head> tag and, 18IHttpHandler interface, 86intrinsic objects, 100–101methods, 103–108overview, 99–100page framework and, 22properties, 100–103rendering methods, 103–104runtime environment and, 84–85script-related methods, 106–108tracing properties, 199Web applications and, 15worker properties, 101–102

page compilation attributes, 92–94@Page directive, 46, 91, 92, 92–96page directives

@Assembly, 96–97global.asax file and, 509–510@Implements, 98@Import, 97–98@Page, 46, 91, 92, 92–96pages and, 11processing, 91–99@Reference, 99supported, 91–92

page errors, 188–196. See also errors; exceptionserror handling, 188–192error pages, 192–196overview, 188validation controls and displaying information

about, 167–168page factory, 89–90page finalization, 114–116

generating markup, 116PreRender event, 115PreRenderComplete event, 115SaveStateComplete event, 115Unload event, 116

page layout, 11, 13page-level error handling, 190page output attributes, 95–96

page-output caching, 624–644. See also cachingASP.NET 2.0 features, 641–644caching profiles, 641–642database dependencies and, 630duration, 626–627HttpCachePolicy class and, 630–632HttpResponse object, 526, 529–530IIS 6.0 kernel caching and, 627–628locations, 628–630of multiple versions of pages and, 633–636@OutputCache directive, 625–630overview, 624–625partial page caching and cacheable pages, 641post-cache substitution, 642–644postback pages, 633–635server cache-validation callbacks, 632Shared attribute and, 640–641user controls and partial page caching, 636–641vary by controls options, 638–640vary by custom strings options, 635–636vary by headers options, 635vary by parameters options, 633

Page property, 101, 122page setup, 110–113

handling dynamically created controls, 113Init event, 111InitComplete event, 111Load event, 112overview, 110–113PreInit event, 111PreLoad event, 112processing posted data, 112view-state restoration, 112

PageAdapter property, 101PageCount property, 415, 431, 471PageHandlerFactory class, 89, 90PageIndex property, 431, 471PageIndexChanged event, 418, 432, 472PageIndexChanging event, 432, 472Pager item type, 417pager rows. See also paging

FormView control, 491GridView control, 446–448

PagerSettings property, 430, 469PagerStyle property, 415, 429, 470PagerTemplate property, 430, 471

PagerTemplate property

Z01I621764.fm Page 735 Monday, October 3, 2005 2:04 PM

Page 32: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

736

pages, 79–117adding code to. See codeapplications and, 15ASP.NET programming model and structure of,

11–14asynchronous, 110caching. See page-output cachingcode review, 13–14component model and, 8controls and, 49creating view-stateless, 587debugging, 196–197. See also debuggingdesigning, 45–53development stack and, 22–23embedding FormView controls, 492–493enabling themes on, 241–242events, 22form-based programming and, 175. See also formsgetting default data item, 378HttpServerUtility class and embedding external,

519–521interaction with DataGrid control, 423–427invoking, 79–99linking assemblies to, 97login. See login pagesoverview, 79, 116–117Page class. See Page classpage directives, code, and page layout, 11–12. See

also page directives; page layoutpage errors. See page errorspage finalization, 114–116. See also page finalizationpage life cycle, 110–116. See also life cycle, pagepage setup, 110–113. See also page setuppage state, 6page throughput, 577–578partial page page-output caching and cacheable, 641personalization, 23, 202, 206–212. See also themes;

user profilespostbacks, 113–114presentation layer and, 20processing directives, 91–99prototyping, 23@Reference directive and, 99representing requested, 84–85rich. See content pages; master pages; themes; user

controls; Wizard controlruntime environment and processing requests,

86–91

runtime environment, process models, and, 80–86sample, 12–13scenarios for ADO.NET asynchronous commands,

305–307, 307scripting, 22site precompilation and, 71styling, 23supported page directives, 91–92test, 48tracing. See tracingview state. See view stateVisual Studio .NET 2005 constraints and, 39Visual Studio .NET 2005 page design features,

45–53Web application development and, 4, 20

PageSize property, 415, 431pagewide tags, runat attribute and, 17–18paging

DataGrid control, 424–425DetailsView control, 475–477, 477FormView control, 491ObjectDataSource control, 399–400

paging, GridView control, 442–448algorithms, 446callbacks for, 454codeless, 443–444configuring pagers, 446–448Data Access Layer (DAL), 444–446

Panel control, 148, 152Parameter object, 266Parameter type, 389ParameterCollection class, 389–390parameters

aspnet_compiler tool, 71filter expressions vs., 388named, 296ObjectDataSource control, 397–398, 403–404page-output caching and, 633SqlCommand class, 294SqlDataSource control, 389–390

Parameters property, 294Params property, 533Parent property, 101, 122ParentColumns property, 346ParentKeyConstraint property, 346ParentRelations property, 341ParentTable property, 346ParseControl method, 105, 106

pages

Z01I621764.fm Page 736 Monday, October 3, 2005 2:04 PM

Page 33: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

737

partial classes, 48, 85–86partial page page-output caching, 636–641

cacheable pages andpage-output caching, 641

Shared attributepage-output caching and, 640–641

user controls andpage-output caching, 636–638

vary by controls optionspage-output caching, 638–640

PartialCaching attribute, 630partitionResolverType attribute, 554Passport authentication, 660PassportAuthentication module, 503PassportAuthorizationModule module, 660Passthrough value, 328Password attribute, 281PasswordAttemptWindow property, 677, 683PasswordRecovery control, 698–699passwords. See also authentication; authorization;

credentials; usernamesChangePassword control, 699–701changing, with ChangePassword method, 277–278CreateUserWizard control, 701login pages and, 662–663Membership class and managing, 681PasswordRecovery control

password retrieval, 698–699sample shared class for strong, 55–57

PasswordStrengthRegularExpression property, 677, 684

path attribute, 668Path property, 533PathInfo property, 533per-request caching, 609performance

linking assemblies, 97nested master pages, 231page-output caching, 635session state management best practices, 573SQLServer session-state provider, 562view state, 577–578

permissions. See also accounts; securityAccess databases, 393application deployment and, 68, 69configuring <trust> section, 655–656default account, 654granting, beyond trust levels, 657–658

NTFS, 659session-state providers and, 563trust levels and, 656–657Visual Studio .NET 2005 local Web server and, 65XCopy deployment and, 67–68

Persist Security Info attribute, 282persistence, data. See data persistence, session statepersonalization, 23, 202. See also themes; user profilespersonalization events, 210–212Personalize event, 210–212PhysicalApplicationPath property, 533PhysicalPath property, 533Pics method, 529pipeline, HTTP, 86, 649. See also runtime environmentPipeline scope, <object> tag, 511PlaceHolder control, 157placeholders, 13, 46, 47policies, cache, 526polling, 612, 616, 624Pooling attribute, 288pooling, connection. See connection poolingpools, application, 83post-cache substitution, page-output caching, 642–644POST command, 9, 10Post method, 178PostAcquireRequestState event, 505, 507postal support addresses, xxiPostAuthenticateRequest event, 505, 506PostAuthorizeRequest event, 505, 506postbacks, 113–114. See also cross-page postings

Controls collection and, 158DataGrid control, 423–424detecting control state changes, 113–114executing server-side, 114HTML container controls and, 136LoadComplete event, 114Page class and, 101page-output caching and, 633–635SelectedIndexChanged event and, 366triggering, 150view state restoration and, 112

PostBackUrl property, 149, 183–184posting, cross-page. See cross-page postingsPostMapRequestHandler event, 505, 506PostReleaseRequestState event, 505, 507PostRequestHandlerExecute event, 505, 507PostResolveRequestCache event, 505, 506PostUpdateRequestCache event, 505, 507

PostUpdateRequestCache event

Z01I621764.fm Page 737 Monday, October 3, 2005 2:04 PM

Page 34: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

738

precompilation, site. See site precompilationprefilling schemas, 326–327Prefix property, 334, 341PreInit event, 108, 111, 210, 243, 246–247PreLoad event, 108, 112Prepare method, 295PreRender event, 108, 115, 125PreRenderComplete event, 108, 115PreRequestHandlerExecute event, 505, 507PreSendRequestContent event, 505PreSendRequestHeaders event, 505presentation layer

adaptive rendering, 21custom controls, 21development stack and, 20–21rich controls, 21

PreserveChanges value, 324PreviousButtonClick event, 252PreviousHandler property, 515_PREVIOUSPAGE hidden field, 187PreviousPage property, 101, 183–184, 185, 187@PreviousPageType directive, 184, 187PrimaryKey property, 341Printing permission, 656Priority attribute, 596priority, Cache object item, 602priority levels, Cache object, 602privileges. See permissionsprocess identity, 652–654. See also accounts

anonymous account impersonation, 653–654changing default account for, 652default account privileges, 654fixed identity impersonation, 652–653

process modelsIIS 5.0, 81–82IIS 6.0, 82–84project compilation and, 63runtime environment, 24

<processModel> section, configuration file, 81, 82, 84processor requirements, xixProcessRequest method, 86, 87, 90, 100, 110, 111Profile module, 503Profile property, 203, 208–210, 515profile providers, 212–215

aspnetdb.mdf structure, 214–215configuring, 213–214custom, 215default, 203overview, 212–215

ProfileParameter type, 389ProfileProvider class, 34profiles, caching, 641–642. See also page-output

cachingprogramming. See ASP.NET programmingprogramming languages. See languages, programmingProgramming Microsoft ADO.NET 2.0

Applications:Advanced Topics, 275, 659Programming Microsoft ADO.NET 2.0

Applications:Core Reference, 275Programming Microsoft ASP.NET 2.0

Applications:Advanced Topics, 110, 120, 121, 141, 220, 287, 307, 358, 368, 378, 382, 454, xvii

programming model, 3–35ASP.NET component model and, 15–20ASP.NET development stack and, 20–27event-driven programming over HTTP and, 6–8HTTP protocol and, 8–11overview, 34–35providers and, 27–34structure of ASP.NET pages and, 11–14Web application development history and, 3–5Web Forms model and, 5–6

projects, 45–65. See also Visual Studio .NET 2005adding code, 53–57Class Library projects, 55compilation, 63. See also compilation; site

precompilationconstraints, 38–39copying, 42–44debugging, 63–65import and export of IDE features and, 52–53overview, 45page design features, 45–53partial classes in, 85–86protected directories, 57–63setup projects, 67solutions vs., 38testing, 65

propertiesaccessing user profile, 208–210BaseValidator class, 161Cache objects, 593–594CacheDependency class, 610–611code refactoring and, 51–52component model and, 15connection string, 281–282Control class, 121–124data adapter, 321–322

precompilation

Z01I621764.fm Page 738 Monday, October 3, 2005 2:04 PM

Page 35: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

739

data source-based data binding. See properties, data source-based data binding

DataGrid control, 414–416DataRelation object, 346DataSet object, 333–334DataSourceView class, 384–385DataTable object, 340–342DataView object, 348–349DetailsView control, 468–472exposing master page, 233–234FormsAuthentication class, 665–666global.asax file static, 511–512GridView control, 428–431GridView control column, 434–435HTML server control, 19, 130HtmlForm class, 176–178HttpApplicationState object, 539HttpCachePolicy class, 631HttpContext class, 515–516HttpRequest objects, 531–534HttpResponse object, 524–527HttpServerUtility class, 518HttpSessionState class, 548–549IButtonControl interface, 149–150invoking master page, 234LoginStatus control, 695–696LoginView control, 696Membership class, 676–678MembershipProvider class, 683–684ObjectDataSource control, 394–395Page class. See properties, Page classProperties window and, 38Roles class, 689–690SiteMapDataSource control, 406–407SqlCommand class, 293–295SqlConnection class, 275–276SqlDataReader class, 297–298SqlDataSource control, 387–389, 391–392StateBag class, 574–575user profiles and grouping, 205–206WebControl class, 145–147Wizard control, 250, 250–251, 253XmlDataSource control, 407–408

properties, data source-based data binding, 357–362AppendDataBoundItems property, 361DataKeyField property, 361–362DataMember property, 359DataSource property, 357–358

DataSourceID property, 358–359DataTextField property, 359–360DataValueField property, 360–361

properties, Page class, 100–103context properties, 102–103intrinsic objects, 100–101tracing, 199worker properties, 101–102

Properties window, 38, 54property page, visual editor, 76protected directories. See also directories

additional application directories, 57–58App_Code directory, 58–59App_LocalResources and App_GlobalResources

resource directories, 59–62linked Web services and App_WebReferences

directory, 62themes and App_Themes directory, 62–63Visual Studio .NET 2005 projects and, 57–63

protection attribute, 668prototyping, page, 23Provider attribute, 204provider classes

available types of, 33–34providers and, 26, 27, 30–31

Provider property, 406, 677, 689provider toolkit, 34ProviderBase class, 31, 32, 682ProviderName property, 388providers

ADO.NET data providers. See ADO.NET data providers

application services and, 25–27ASP.NET implementation, 30–34ASP.NET programming model and, 27–34available types of providers, 33–34benefits of, 30configuration layer, 32custom session-state providers. See custom session-

state providersdefault state, 568encryption, 285examples, 27–29interfaces vs. base classes and, 31–32membership providers. See membership providersout-of-process session-state providers. See SQLServer

session-state provider; StateServer session-state provider

providers

Z01I621764.fm Page 739 Monday, October 3, 2005 2:04 PM

Page 36: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

740

providers, continuedoverview, 213provider classes. See provider classesprovider toolkit and, 34rationale behind, 27–30role providers, 690–691selecting and configuring, with Web Site

Administration Tool (WSAT), 75state client managers, 543–545storage layer, 33strategy pattern and, 27Web Site Administration Tool (WSAT) and, 72, 73

Providers property, 677, 684, 689<providers> section, configuration file, 32–33proxy classes, 62pwd attribute, 281

QQueryString property, 533QueryStringParameter type, 389question mark (?), 296? (question mark), 296questions, email and postal addresses for, xxi

RRadioButton control, 148, 151RadioButtonList control, 365–366RaisePostBackEvent method, 114RaisePostDataChangedEvent method, 113, 138RAM requirements, xixRangeValidator control, 160, 161, 165–166RawUrl property, 533Read method, 298, 299–300ReadCommitted isolation level, 309readOnly attribute, 204ReadUncommitted isolation level, 309ReadXml method, 334, 342ReadXmlSchema method, 334, 342record-view controls, 467, 497–498. See also

DetailsView control; FormView controlrecords. See rowsRecordsAffected property, 297Redirect method, 521, 529RedirectFromLoginPage method, 667redirection

cross-page postings and, 187HttpServerUtility class and server-side, 521

RedirectLocation property, 525RedirectToLoginPage method, 667reentrant forms, 6refactoring, code, 51–52@Reference directive, 91Reflection permission, 657regenerateExpiredSessionId attribute, 555Regex object, 165@Register directive, 17, 19, 91RegisterArrayDeclaration method, 107RegisterClientScriptBlock method, 107RegisterHiddenField method, 107, 153registering

assemblies and, 67custom session-state providers, 570–571

RegisterOnSubmitStatement method, 107RegisterRequiresControlState method, 105RegisterRequiresPostBack method, 105RegisterRequiresRaiseEvent method, 105RegisterStartupScript method, 107RegisterViewStateHandler method, 105Registry permission, 657regular expressions, 702RegularExpressionValidator control, 160, 165RejectChanges method, 335, 342RelationName property, 346relations. See DataRelation objectsRelations property, 334ReleaseItemExclusive method, 569ReleaseRequestState event, 505, 507remote servers. See also servers

copying Web projects to, 42–44session-state provider. See StateServer session-state

providerremoting format, DataSet object, 339–340RemotingFormat property, 334, 341Removal Callback attribute, 597Remove method, 540, 549, 575, 594RemoveAll method, 540, 549RemoveAt method, 540, 549Removed removal reason, 598RemoveItem method, 569RemoveOutputCacheItem method, 529RemoveSessionID method, 572RemoveUserFromRole method, 689RemoveUserFromRoles method, 689RemoveUsersFromRole method, 689RemoveUsersFromRoles method, 689, 690

Providers property

Z01I621764.fm Page 740 Monday, October 3, 2005 2:04 PM

Page 37: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

741

RenderBeginStyle method, 147RenderControl method, 104, 124, 178RenderEndTag method, 147rendering

Page class methods, 103–104page finalization, 114–116presentation layer and adaptive, 21server controls and adaptive, 125server controls and browser-sensitive, 126–127

RenewTicketIfOld method, 667RepeatColumns property, 364RepeatDirection property, 364RepeateableRead isolation level, 309Repeater control, 357, 368–370RepeatLayout property, 364Request objects

forms and, 11Page class and, 100

Request property, 502, 515request type properties, HttpRequest object, 531–532requests, processing. See runtime environmentRequestType property, 531RequiredFieldValidator control, 160, 162, 166, 172,

185–186requirements, xviii–xixRequiresQuestionAndAnswer property, 677, 684requireSSL attribute, 668, 673–674RequireSSL property, 666RequiresUniqueEmail property, 684Reset method, 147, 335, 342ResetCommandTimeout method, 295ResetItemTimeout method, 569ResetPassword method, 683ResetStatistics method, 277ResolveClientUrl method, 124ResolveRequestCache event, 505, 506ResolveUrl method, 106, 124resources

aspnet_isapi.dll and, 81directories for, 58, 59–62embedding static, 104help. See help resourcesHttpContext class and loading, 517Visual Studio .NET 2005 and declarative, 39

Resources: XXX expression, 381Resources namespace, 62response filters, HttpResponse object, 526–527

Response objectsforms and, 11Page class and, 100

Response property, 502, 515ResponseEncoding attribute, 95restarts, application, 80, 87, 90–91result sets, multiple ADO.NET, 301–302.resx file extension, 58. See also resourcesRetrieveStatistics method, 277ReturnProviderSpecificTypes property, 321reusability, code, 30RewritePath method, 516rewriting, HttpContext class and URL, 517rich controls, 21rich pages, 219–220, 259–260. See also master pages;

themes; user controls; visual inheritance; Wizard control

robustnesserror handling, 192SQLServer session-state provider, 562

role management, 686–691LoginView control role-based login templates,

697–698membership and, 675–676. See also membershiprole providers and RoleProvider class, 690–691Roles class, 688–690users, authorization, and, 686–687Web Site Administration Tool (WSAT) and, 73–74,

687–688role providers, 690–691RoleExists method, 689, 690RoleGroups property, 696RoleManager module, 503RoleProvider class, 34, 690–691Roles class, 688–690

methods, 688–689properties, 689–690

Rollback method, 309Root Folder permissions

application, 654.NET Framework, 654Web site, 654

RowCancelingEdit event, 432RowCommand event, 432RowCreated event, 432RowDataBound event, 432RowDeleted event, 432

RowDeleted event

Z01I621764.fm Page 741 Monday, October 3, 2005 2:04 PM

Page 38: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

742

RowDeleting event, 432RowEditing event, 432RowFilter property, 349RowHeaderColumn property, 428rows. See also DataRow objects

DataGrid control displayed and data source, 417–418

DataSet RowState property, 337DataView object, 350–351editing DataGrid control, 426–427FormView control header, footer, and pager, 491

rows, GridView controlcustomization, 463–464deleting, 458–459executing operations on one, 460–462inserting new, 459selecting one, 462–463updating, 455–458

Rows property, 341, 431, 471RowState property, 337RowStateFilter property, 349RowStyle property, 429, 470RowUpdated event, 432RowUpdating event, 432RSA encryption algorithm, 139, 286RSAProtectedConfigurationProvider, 285run-time controls, 16runat attribute

component model and, 16–19Page class methods and, 106page code and, 12, 14pagewide tags and, 17–18server controls and, 11, 16, 16–17, 109unknown tags and, 18–19Web server controls and, 145

runtime environmentapplication configuration and, 25. See also

configurationapplication services and, 25–27causes for application restarts, 90–91data-binding expressions and, 375–376development stack and, 24–27HTTP request context. See HTTP request contextHttpApplication class, 89HttpApplicationFactory object, 88–89HttpRuntime object, 87–88IIS 5.0 process model and, 81–82

IIS 6.0 process model and, 82–84overview, 80–81, 86–87page factory and handler factory objects, 89–90pages and, 79, 80–86partial classes and, 85–86process models and, 24processing requests, 86–91providers and, 30representing requested pages, 84–85security context, 649state management by, 6–7system HTTP modules and, 25Web applications and, 15XCopy deployment and configuring, 68–69

Ssandboxing, code, 658SaveAs method, 143, 534SavePageStateToPersistenceMedium method, 115SaveSessionID method, 572SaveStateComplete event, 108, 115SaveViewState method, 115saving

requests to disk files, 534–535view state, 115, 587–588

scalability, HTTP protocol, 5SchemaOnly parameter, 300schemas

accessing information, with GetSchema method, 278–280

App_Code directory and, 59prefilling, 329–330Visual Studio .NET 2005 and, 44, 50–51

SchemaSerializationMode property, 334SchemaType enumeration, 329–330scopes, server-side <object> tag, 511<script> section, configuration file, 98<script> tags, 11scripting. See also code

page, 22Page class methods for, 106–108Page class script-related methods, 106–108script callbacks. See callbacks

scrollable panel control, 152Secure Sockets Layer (SSL), 650, 673–674secured sockets, Forms authentication and, 673–674

RowDeleting event

Z01I621764.fm Page 742 Monday, October 3, 2005 2:04 PM

Page 39: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

743

security, 647–703anonymous account impersonation, 653–654application trust levels, 655–658ASP.NET pipeline security context, 652ASP.NET process identity, 652–654attack-resistant code resources, 702authentication methods, 658–660configuring <trust> section permissions, 655–656cookieless sessions and, 553–554default account privileges, 654displaying error messages, 190, 192file authorization and access control lists (ACLs),

659fixed identity impersonation, 652–653Forms authentication. See Forms authenticationgranting permissions beyond trust levels, 657–658IIS thread security context, 649–650membership and role management. See

membership; role managementoverview, 647, 702–703Passport authentication, 660permissions, 656–657. See also permissionssecurity context, 648–660security context levels, 648–649security-related server controls. See server controls,

security-relatedsetting ASP.NET process account, 652SQLServer session-state provider and, 566threats, 648view state, 575–576ViewStateUserKey property, 102Visual Studio .NET 2005 local Web and, 65Web Site Administration Tool (WSAT) and, 73,

73–74Windows authentication, 658worker process security context, 650–651

Security permission, 656Select command, 388Select method, 342, 385<select> tag, 136

HtmlSelect control and, 136SelectCommand property, 321, 387, 444SelectCommandType property, 387SelectCountMethod property, 394SelectedDataKey property, 431SelectedIndex property, 362, 364, 415, 431

SelectedIndexChanged event, 366, 418, 432SelectedIndexChanging event, 432SelectedItem item type, 417SelectedItem property, 362, 364, 415SelectedItemStyle property, 415SelectedRow property, 431SelectedRowStyle property, 429SelectedValue property, 362, 364, 431, 471selection

GridView control single-row, 462–463HtmlSelect control selection boxes, 136

SelectMethod property, 394SelectParameters collection, 397–398SelectParameters property, 387, 394SeparatorTemplate property, 369SequentialAccess parameter, 300Serializable isolation level, 309serialization

DataRelation object, 347–348DataSet object contents to XML, 337–339DataSet object formats for, 339–340StateServer session-state provider, 558–559view state format, 582–583

serializeAs attribute, 204Server attribute, 282server controls, 119–173

adaptive rendering, 125binding container, 123browser-sensitive rendering, 126–127component model and, 7–8, 19–20Control class events, 124–125Control class interfaces, 120–121Control class methods, 124Control class properties, 121–124control state, 128custom controls, 21data-bound. See data-bound controlsHTML server controls, 19. See HTML server controlsID properties, 103identifying, 122input focus assignment, 128–129literal controls, 144naming container, 122–123new features, 125–129overview, 119–120, 172–173page layout and, 11, 13

server controls

Z01I621764.fm Page 743 Monday, October 3, 2005 2:04 PM

Page 40: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

744

server controls, continuedpartial classes and, 86rich controls, 21runat attribute and, 16–17security-related. See server controls, security-relatedthemeable, 127themes and, 244validation controls. See validation controlsvisibility of, 123Web applications and, 15Web server controls, 20. See Web server controls

server controls, security-related, 691–701ChangePassword control, 699–701CreateUserWizard control, 701Login control, 691–694LoginName control, 694LoginStatus control, 694–696LoginView control, 696–698PasswordRecovery control, 698–699

Server location type, 628, 630Server objects

forms and, 11HttpServerUtility class and, 518Page class and, 100

Server property, 502, 515ServerAndClient location type, 630ServerChange event, 137, 140–141ServerClick event, 136, 139servers

cache-validation callbacks, 632copying Web projects to, 42–44global.asax file includes, 511global.asax file <object> tags, 510–511HTTP protocol and abstraction layers, 9–10HttpServerUtility class redirection, 521keeping view state on, 586–589multiple logical forms, 180–182postbacks, 114server controls. See server controlssession-state providers and remote. See StateServer

session-state providervalidation and, 164Visual Studio .NET 2005 local Web, 40, 65

Server.Transfer method, 187ServerValidate event, 163ServerVariables property, 533ServerVersion property, 276services, application, 25–27. See also providers

servlet applications, 4session data dictionary, 570session hijacking attacks, 648session IDs, 550–555

configuring session state, 554–555cookieless sessions, 551–554cookies, 550–551custom generators, 571–573generating, 550

Session objects, 100Session property, 502, 515Session scope, <object> tag, 511session state management, 549–567

configuring session state, 554–555custom session ID generators, 571–573custom session-state providers, 568–571customizing, 567–573event-driven programming over HTTP and, 6–8HttpSessionState class. See HttpSessionState classloss of session state, 557overview, 549–550performance best practices, 573providers and, 28–29, 34. See also session-state

providerssession IDs, 550–555. See also session IDssession lifetime, 555–557session state data persistence to remote servers,

557–561session state data persistence to SQL Server,

562–566Web farms, Web gardens, and, 566–567

session-state providerscustom, 568–571default, 568out-of-process. See SQLServer session-state provider;

StateServer session-state providerSession_End event, 556SessionId column, 564SessionID property, 548sessionIDManagerType attribute, 555SessionItemLong column, 565SessionItemShort column, 565SessionParameter type, 389Session_Start event, 556SessionState module, 503<sessionState> section, configuration file, 554–555SessionStateStoreProviderBase class, 34, 545SessionStateUtility class, 570

server controls, security-related

Z01I621764.fm Page 744 Monday, October 3, 2005 2:04 PM

Page 41: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

745

Set method, 540SetAllowResponseInBrowserHistory method, 631SetAndReleaseItemExclusive method, 569SetAuthCookie method, 667SetCacheability method, 631SetCookie method, 529SetETag method, 631SetETagFromFileDependencies method, 631SetExpires method, 631SetFocus method, 107, 128–129SetFocusOnError property, 161SetItemExpireCallback method, 569SetLastModified method, 631SetLastModifiedFromFileDependencies method, 631SetMaxAge method, 631SetNoServerCaching method, 631SetNoStore method, 632SetNoTransforms method, 632SetOmitVaryStar method, 632SetProxyMaxAge method, 632SetRenderMethodDelegate method, 124SetRevalidation method, 632SetSlidingExpiration method, 632setup, page, 110–113setup projects, 67SetUtcLastModified method, 610SetValidUntilExpires method, 632SetVaryByCustom method, 632Shared attribute, 626, 640–641sharing

creating sample shared class, 55–57page-output caching Shared attribute, 626, 640–641shared Forms authentication cookies, 671–672

ShowFooter property, 415, 430ShowHeader property, 415, 430, 435ShowStartingNode property, 406SideBarButtonClick event, 252, 256SideBarButtonStyle property, 250sidebars, Wizard control, 255SideBarStyle property, 250SideBarTemplate property, 250signing out, 664–665SignOut method, 664–665, 667simple data binding. See data bindingSimpleHandlerFactory class, 90single-form interface (SFI) model

eventing model and, 109–110form-based programming and, 176. See also forms

SingleResult parameter, 300, 301SingleRow parameter, 300, 301site maps, providers and, 34site precompilation, 69–72. See also compilation

for deployment, 70–72in-place, 70overview, 69–72

Site property, 122SiteMapDataSource control, 384, 404–407

displaying site map information, 404–406programming interface, 406–407

SiteMapProvider class, 34SiteMapProvider property, 406size thresholds, view state, 577–578SkinID property, 122skins

applying, 242–243controls and, 23, 127themes and, 62, 238, 239. See also themes

SkipAuthorization property, 515SkipLinkText property, 251Sliding Expiration attribute, 596slidingExpiration attribute, 668SlidingExpiration property, 666SmartNavigation attribute, 95SmartNavigation property, 103Socket permission, 657software requirements, xviii–xixSolution Explorer window, 42, 72solutions, 38, 42. See also projectsSort property, 349, 351SortCommand event, 418SortDirection property, 429Sorted event, 432SortExpression property, 421, 429, 435sorting, DataGrid control, 425–426Sorting event, 432, 452sorting, GridView control, 449–454

callbacks for, 454codeless, 449–451Data Access Layer (DAL), 451–452user feedback on, 452–453

SortParameterName property, 387, 394source code, 39, 42, 58–59, 69Source value, 330Source view, Visual Studio .NET 2005, 45, 53<span> tag, 13, 17SQL injection attacks, 648, 702

SQL injection attacks

Z01I621764.fm Page 745 Monday, October 3, 2005 2:04 PM

Page 42: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

746

SQL ServerADO.NET data providers and, 268–269custom cache dependency, 616–624as data source, 268Northwind database of SQL Server 2000, xixsession-state provider. See SQLServer session-state

providersession store, 563–565SQL Server 2005. See SQL Server 2005system requirements and, xviii

SQL Server 2005ADO.NET enhancements specific to, 313–317ADO.NET multiple active result sets, 315–317ADO.NET SQL notifications and dependencies,

314–315ADO.NET support for CLR types, 313ADO.NET support for XML as native type, 314cache dependencies, 622–624database cache invalidation, 624system requirements and, xviii

SQL Server 2005 Express Editionconfiguring, xix–xxsystem requirements and, xviii

SqlCacheDependency property, 391, 622SqlClient permission, 656SqlCommand class, 293–297

methods, 295–296, 301overview, 293properties, 293–295synchronous and asynchronous execution, 296–297

SqlCommandBuilder class, 331–332sqlCommandTimeout attribute, 555SqlConnection class, 275–280

accessing schema information, 278–280changing passwords, 277–278methods, 276–277overview, 275properties, 275–276

sqlConnectionString attribute, 555SqlDataAdapter class, 320–326

filling DataSet objects with, 323–324interfaces, 320loading options, 324–326properties and methods, 321–323

SqlDataReader class, 297–299, 314

SqlDataSource control, 384, 386–392caching, 391–392conflict detection, 390–391declarative parameters, 389–390ObjectDataSource control vs., 454–455, 477overview, 386–387paging and, 444programming interface, 387–389

SqlDependency attribute, 626SqlDependency class, 315SqlNotificationRequest class, 315SQLOLEDB provider, 270SqlParameter class, 294, 296SQLServer mode, 544SQLServer session-state provider, 562–566

configuring, 562–563performance and robustness of, 562reverting to hosting identity, 566storing session data, 563–565

SQLServer state provider, 568SqlSessionStateStore class, 568Src attribute, 93, 97SSL (Secure Sockets Layer), 673–674Start property, 253StartFromCurrentNode property, 406StartingNodeOffset property, 406StartingNodeUrl property, 406StartNavigationTemplate property, 250StartRowIndexParameterName property, 394StartStepNextButtonStyle property, 250state management, 537–590

component model and, 15control state. See control stateevent-driven programming over HTTP and, 6–8HttpApplicationState objects and application state,

538–542objects, 538overview, 537, 589–590page view state. See view statesession state. See HttpSessionState class; session

state managementtable row state, 337

state objects, Cache object, 592–593

SQL Server

Z01I621764.fm Page 746 Monday, October 3, 2005 2:04 PM

Page 43: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

747

state propertiesDetailsView control, 470–471GridView control, 430–431

State property, 276StateBag class, 574–575

methods, 575overview, 574properties, 574–575

stateConnectionString attribute, 555stateless programming

event-driven programming over HTTP and, 6–8HTTP protocol and, 5

stateNetworkTimeout attribute, 555StateServer mode, 544StateServer session-state provider, 557–561

configuring, 560–561overview, 557–558state serialization and deserialization for, 558–559storing session data, 559–560

StateServer state provider, 568static properties, global.asax file, 511–512StaticObjects property, 539, 548StatisticsEnabled property, 276status line, HTTP response, 9Status property, 525StatusCode property, 525StatusDescription property, 525Step property, 253step styles, Wizard control, 253StepNavigationTemplate property, 250StepNextButtonStyle property, 250StepPreviousButtonStyle property, 250StepStyle property, 250StepType property, 253storage layer, providers and, 33stored procedures, 294–295, 444, 617–618, 624StoredProcedure parameter, 294stores, session-state. See session-state providersstrategy pattern, 27, 31Strict attribute, 93, 94strings, page-output caching and custom, 635–636strong passwords sample shared class, 55–57style properties

DetailsView control, 470GridView control, 429Web server control, 146–147Wizard control, 250

Style property, 19, 130, 146, 146–147style sheet themes, 238, 240. See also themesStylesheetTheme attribute, 95StyleSheetTheme attribute, 242StyleSheetTheme property, 103submit buttons, 114Substitution control, 644suffixes, Wizard control button, 251summary error information, 169–170support. See help resourcesSuppressContent property, 525synchronization

Cache object, 608–609Copy Web site feature and, 44, 66HttpApplicationState object state, 540–541session state access with HttpSessionState class,

546–547thread, 305

SyncRoot property, 548syntax

global.asax file, 509–512syntax-coloring feature, 39, 44

System Folder permissions, 654system HTTP modules, 25system requirements, xviii–xixSystem.Configuration.dll, 96System.Data.dll, 96System.Data.Odbc namespace, 268System.Data.OleDb namespace, 268System.Data.OracleClient namespace, 268System.Data.SqlClient namespace, 268System.Diagnostics namespace, 197System.dll, 96System.Drawing.dll, 96System.EnterpriseServices.dll, 96System.Net.Mail namespace, 191System.Web.dll, 96System.Web.Mobile.dll, 96System.Web.Services.dll, 96System.Web.UI namespace, 99

overview, 120System.Web.UI.HtmlControls namespace, 19, 130System.Web.UI.WebControls namespace, 19, 137, 145System.Xml.dll, 96

System.Xml.dll

Z01I621764.fm Page 747 Monday, October 3, 2005 2:04 PM

Page 44: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

748

TT-SQL checksum functions, 618TabIndex property, 146table constraints, DataTable object, 344–345Table control, 137, 148, 154table-mapping mechanism, data adapter, 326–330

column-mapping mechanism, 327–328missing mapping actions, 328missing schema actions, 329overview, 326–327prefilling schemas, 329–330

Table property, 349<table> tag, 136–137, 154TableCell control, 148TableDirect parameter, 294TableMappings property, 321TableName property, 341TableRow control, 137, 148tables. See also DataTable objects

HtmlTable control and, 136–137Table control and, 154table row state, 337

Tables property, 334tabular data source controls, 384TagName property, 130tags. See also HTML

HTML server controls and, 19, 129runat attribute and pagewide, 17–18runat attribute and unknown, 18–19Visual Studio .NET 2005 formatting, 50

Target property, 367target schema validation, Visual Studio .NET 2005,

50–51TCP (Transmission Control Protocol), 8Technology Updates Web page, xxtemplate properties

DetailsView control, 471–472Wizard control, 250

TemplateColumn column type, 419TemplateControl class, 99–100TemplateControl property, 122TemplateField column type, 434, 442templates

DataGrid control templated columns, 423DetailsView control templated fields, 485–486FormView control, 490, 494–495, 496GridView control templated fields, 441–442Login control, 693

LoginView control login, 697–698master pages as. See master pagesthemes and, 239Visual Studio .NET 2005 item, 46

TemplateSourceDirectory property, 101, 122templating properties, GridView control, 430Temporary ASP.NET Files directory, 58, 654temporary files, 68terminology, themes, 237–238testing

pages, 13pages with localization, 61projects, 65test pages, 48tested OLE DB providers, 270XML cache dependencies, 615–616

text boxes, HtmlTextArea control, 137–138, 137–138text control, 20text controls, 152–153text/html MIME type, 10Text parameter, 294Text property, 20, 149, 161TextAlign property, 364<textarea> tag, 137–138TextBox control, 20, 149, 152–153Theme attribute, 95, 242Theme property, 103Themeable attribute, 244themes, 236–247

advantages of creating, 244applying skins, 242–243App_Themes directory, 62–63creating, 245–246CSS (cascading style sheet) files, 23, 239, 244–245customization vs. style sheet, 240definition and terminology, 237–238directory for, 58disabling, 243dynamically loading, 246–247enabling, on pages, 241–242overview, 236–237Page class properties and, 102page styling with, 23personalization and, 202rich pages and, 219server controls and, 127, 244skins and, 62, 238, 239structure of, 238–240theming pages and controls, 241–244

T-SQL checksum functions

Z01I621764.fm Page 748 Monday, October 3, 2005 2:04 PM

Page 45: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

749

threads. See also asynchronous ADO.NET commands; locks

AppDomains and, 24asynchronous handlers and, 110

threats, security, 648, 702timeout attribute, 555, 668Timeout column, 565Timeout property, 548Timestamp property, 516Title property, 103, 135<title> tag, 135titles, master page, 229tlbimp.exe tool, 522toolbox, Visual Studio .NET 2005, 49ToolTip property, 146ToolTips, 135, 150TopPagerRow property, 431, 471TotalBytes property, 531Trace attribute, 93Trace objects, 100, 197, 200–201Trace property, 516trace viewer tool, 201–202TraceContext class, 100, 199–200TraceEnabled property, 103, 199TraceMode attribute, 93TraceMode property, 199TraceModeValue property, 103, 199tracing, 197–202. See also debugging

execution flow, 197–199overview, 197trace viewer tool and, 201–202Web Site Administration Tool (WSAT) and, 74writing trace messages, 199–201

Transaction attribute, 95Transaction object, 266Transaction property, 294transactions, ADO.NET, 308–313

distributed transactions in ADO.NET 1.x, 312–313distributed transactions with TransactionScope

object, 311–312local vs. distributed, 308managing ADO.NET 1.x local, 308–310TransactionScope object, 310–311

TransactionScope object, 310–312Transfer method, 187, 519, 521Transform property, 408TransformArgumentList property, 408

transformations, XML, 157, 410TransformFile property, 408transition event handlers, 254Transmission Control Protocol (TCP), 8TransmitFile method, 529, 530triggers, cache dependency, 617–618trust levels, 655–658

configuring <trust> section permissions, 655–656granting permissions beyond, 657–658overview, 655–658permissions, 656–657

<trust> section, configuration file, 655–656Trusted Connection attribute, 281try/catch/finally blocks, 192, 290Type attribute, 204Type Library Importer tool, 522Type property, 138types. See also classes

attributes and, 92CLR, 313DataGrid columns, 419–420DataGrid items, 416–417GridView columns, 434parameter, 389–390request, 531–532user profiles and custom, 205XML, 314

UUICulture attribute, 61, 95uid attribute, 282Unchanged state, 337_ (underscore), 122underscore (_), 122Underused removal reason, 598unhandled exceptions. See also exceptions

default error pages and, 188–190error pages and, 192–196. See also error pagesoverview, 188robust error handling and, 192

UniqueConstraint class, 345UniqueID property, 103, 122, 138unknown tags, runat attribute and, 18–19Unload event, 108, 116, 125UnloadAppDomain method, 87, 91Unlock method, 540unsupported function exception, 477–497Up browser ID, 228

Up browser ID

Z01I621764.fm Page 749 Monday, October 3, 2005 2:04 PM

Page 46: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

750

Update method, 322, 385UpdateBatchSize property, 321UpdateCommand event, 418UpdateCommand property, 321, 387UpdateCommandType property, 387UpdatedRowSource property, 294UpdateItem method, 490UpdateMethod property, 394UpdateParameters property, 387, 394UpdateRequestCache event, 505, 507updates

GridView control, 455–458Microsoft Press Technology Updates Web page, xxObjectDataSource control, 401–403site precompilation and, 71–72

UpdateUser method, 678, 683uploading files, HtmlInputFile control and, 141–144Upsert value, 324URL navigation, HtmlAnchor control, 135Url property, 533URL rewriting, HttpContext class, 517UrlAuthorization module, 503URLAuthorizationModule module, 659UrlDecode method, 519UrlEncode method, 519UrlPathEncode method, 519UrlReferrer property, 533UseAccessibleHeader property, 415, 429, 469UseCookie value, 670UseCookies mode, 552UseDeviceProfile mode, 552UseDeviceProfile value, 671useHostingIdentity attribute, 555User-Agent header, HTTP, 9user controls, 219–222

benefits of, 220–221compiling, 79@Control directive and, 92disadvantages of, 221overview, 119page prototyping and, 23partial page page-output caching and, 636–641@Reference directive and, 99rich pages and, 219, 220toolbox and, 49

User ID attribute, 282User objects, 100user profiles, 202–215, 202–215

accessing profile properties, 208–210anonymous users and, 207–208collection types and, 205creating, 203–206creating profile databases, 206–207custom types and, 205data model class, 204–205data model definition, 203–204grouping properties, 205–206migrating anonymous data, 212overview, 202page interaction, 206–212personalization and, 202personalization events, 210–212profile providers and, 212–215providers and, 33

User property, 502, 516UserAgent property, 531UserHostAddress property, 533UserHostName property, 533UserIsOnlineTimeWindow property, 677UserLanguages property, 533usernames. See also authentication; authorization;

credentials; passwordsauthenticating, 663–664CreateUserWizard control, 701Membership class and managing, 681

usersaccounts. See accountscredentials. See credentials; usernamesGridView control sorting and user feedback,

452–453providers and user roles, 33user-defined dynamic data-binding expressions,

380–382user-specific information. See personalization; user

profilesUseSubmitBehavior property, 114, 150UseUri mode, 552UseUri value, 671UtcLastModified property, 610

Update method

Z01I621764.fm Page 750 Monday, October 3, 2005 2:04 PM

Page 47: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

751

VValidate method, 106, 159, 572ValidateInput method, 534ValidateRequest attribute, 95ValidateUser method, 678, 679–680, 683validation. See also validation controls

CausesValidation property and controlling, 140client vs. server, 164enabling client, 170–171HttpRequest object, 535server cache-validation callbacks, 632user authentication. See authenticationwithout validation controls for DetailsView control,

488–489validation controls, 159–172

BaseValidator class properties, 161CompareValidator control, 162–163ControlToValidate property and associating input

controls with, 162cross-page postings and, 185–186CustomValidator control, 163–164DetailsView control and, 486–488displaying error information, 167–168enabling client validation, 170–171overview, 159–161RangeValidator control, 165–166RegularExpressionValidator control, 165RequiredFieldValidator control, 166ValidationGroup property and validation groups,

171–172ValidationSummary control, 168–170

ValidationExpression property, 165ValidationGroup property, 149, 161, 171–172ValidationProperty attribute, 162ValidationSummary control, 161, 168–170Validators property, 101, 159Value attribute, 596Value property, 19, 20, 138Values property, 574ValueToCompare property, 163VaryByControl attribute, 626, 638–640VaryByCustom attribute, 626, 635–636VaryByHeader attribute, 626, 635VaryByHeader property, 631VaryByHeaders property, 635

VaryByParam attribute, 626, 633VaryByParams property, 631, 633.vb file extension, 42, 81.vbproj file extension, 81VBScript, 108VerifyRenderingInServerForm method, 104, 175video requirements, xixView control, 149, 158–159. See also MultiView controlview state, 573–589

changes in ASP.NET 2.0, 581–585common issues with, 575–578control state and, 128, 583–585creating view-stateless pages, 587disabling, 578–581encrypting and securing, 575–576eventing model and, 109keeping, on servers, 586–589loading, from Web server files, 588–589LosFormatter class and, 586machine authentication check, 576ObjectStateFormatter class and, 586–587overview, 573–574Page class events and, 111Page class properties and, 102postbacks and, 113_PREVIOUSPAGE hidden field and, 183restoration, 112saving, 115saving, to Web server files, 587–588serialization format, 582–583size thresholds and page throughput, 577–578StateBag class, 574–575ViewStateUserKey property, 102

views, data source controls and, 384–385. See also DataView objects; MultiView control; View control

ViewState collection, 111ViewState dictionary, 115_VIEWSTATE hidden field, 112, 115ViewState objects, 538ViewStateEncryptionMode property, 103ViewStateUserKey property, 101, 102virtual directories, IIS, 40–41, 67VirtualItemCount property, 415

VirtualItemCount property

Z01I621764.fm Page 751 Monday, October 3, 2005 2:04 PM

Page 48: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

752

visibilityserver control, 123state management objects, 538

Visible property, 103, 122, 123, 149, 421Visual Basic .NET, 5, 290visual designers, 38visual editor, web.config files and, 75–77visual inheritance, 221–222Visual Studio .NET 2005, 37–78

administering applications, 72–77application deployment, 66–72ASP.NET Web site administration console, 33Community Technical Preview (CTP) prelease

software, xxconfiguration files, 669constraints, 38–39Copy Web site feature, 42–44global.asax file, 191, 507highlights, 40–45IDE-level constraints, 39lack of IIS dependency, 40machine-level constraints, 38–39master pages and, 232Microsoft Press Technology Updates Web page, xxoverview, 37–38, 77–78project compilation, 42projects. See projectssmarter editing with IntelliSense, 44–45system requirements and editions of, xviiithis book and, xviiiunique IDs and, 16Web site access methods, 40–41

visual styles. See themesvisualizers, 64–65.vssettings file extension, 52

WW3C Markup Validation Service, 127w3wp.exe worker process, 24, 63, 83Warn method, 200WarningLevel attribute, 93Watch windows, 64–65Web Administration Service (WAS), 83

Web application development. See also ASP.NET programming

ASP.NET component model and, 15developers and this book about, xviiihistory of, 3–5, xvii–xviiiin Visual Studio .NET 2005. See Visual Studio .NET

2005Web farms

application deployment and, 68session state management and, 566–567

Web Forms. See also formsASP.NET programming and, 5, 5–6code and, 53. See also codecode-behind classes and, 48content pages and, 48single-form interface (SFI) model, 109–110Windows Forms model and, 6–7

Web gardenscaching and, 595session state management and, 566–567worker processes and, 81

Web Matrix, 40Web page help resources. See help resourcesWeb permission, 657Web projects. See projectsWeb Resource service, 104Web server controls, 145–159

AdRotator control, 155–156button controls, 149–150Calendar control, 156–157core, 148–154HiddenField and FileUpload controls, 153–154HTML server controls vs., 20HtmlInputCheckBox and HtmlInputRadioButton

controls, 151HtmlTable and Table controls, 154HyperLink control and hyperlinks, 150images and image button controls, 150–151overview, 145Panel control and scrollable panels, 152PlaceHolder control, 157as server controls, 20styling, 146–147

visibility

Z01I621764.fm Page 752 Monday, October 3, 2005 2:04 PM

Page 49: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

753

text controls, 152–153View and MultiView controls, 158–159WebControl class methods, 147WebControl class properties, 145–147Xml control, 157

Web services, App_WebReferences directory and, 62Web Setup projects, 67Web site access methods, Visual Studio .NET 2005,

40–41Web site administration console, Visual Studio .NET

2005, 33Web Site Administration Tool (WSAT)

application settings management, 74–75features of, 72–75membership and role management, 73–74role management and, 687–688selecting and configuring providers, 75

Web Site copy feature, 42–44, 66Web site projects. See projectsWeb Site Root Folder permissions, 654web.config files. See also configuration

application configuration and, 25application deployment and, 68–69application restarts and, 91application settings management, 74assemblies, 96–97authentication settings, 669, 674custom error messages and, 192–193debugging and, 63editing, 80machine.config files and, 57. See also machine.config

filessource code directories, 59visual editor for, 75–77

WebControl classmethods, 147properties, 145–147

WebPermission class, 656WebServiceHandlerFactory class, 90Width property, 146Windows authentication, 658Windows Data Protection API (DPAPI), 285Windows Forms model, 6–7, 72, 355Windows Installer, 67Windows operating system. See Microsoft Windows

Windows SharePoint Services (WSS), 38Windows System Folder permissions, 654WindowsAuthentication module, 503Wizard control, 247–258

adding steps to, 252–255canceling navigation events, 257defining sidebar, 255filtering navigation with events, 255–257finalizing, 258methods, 251–252multiple logical forms and, 182MultiView control and, 159navigating with, 255–258overview, 248–252programming interface, 250–252rich pages and, 219–220structure of, 248–249style and template properties, 250

wizards. See CreateUserWizard control; Wizard control

WizardStep objects, 252–255creating input steps, 253–254defining sidebar, 255overview, 252–253StepType property and WizardStepType

enumeration, 253WizardSteps property, 251WizardStepType enumeration, 253worker processes

runtime environment and, 24worker process security context, 649, 650–651

worker properties, Page class, 101–102Workstation ID attribute, 282WorkStationId property, 276wrapper Cache objects, 605–606Write method, 200, 529WriteFile method, 529WriteSchema write mode, 338WriteSubstitution method, 529WriteXml method, 335, 337–339, 342WriteXmlMode enumeration, 338WriteXmlSchema method, 335, 342.wsdl file extension, 58, 62

.wsdl file extension

Z01I621764.fm Page 753 Monday, October 3, 2005 2:04 PM

Page 50: Z01I621764.fm Page 705 Monday, October 3, 2005 2:04 PM ... · ASPNET account; NETWORK SERVICE account encryption and, 286 permissions. See permissions SQLServer session-state provider

754

XXCopy deployment, 66–69

copying files, 66databases and, 68directories and, 58granting permissions and, 67–68overview, 66runtime configuration and, 68–69Web Setup projects and, 67

XHTML, 126–127XML

connection strings and encryption, 285–287custom cache dependency, 612–617data type, 314serialization of DataSet object contents, 337–339transformations, 157, 410XHTML and, 126–127

Xml control, 157XML data type, 314XmlDataSource control, 384, 407–411

displaying XML data, 408–410programming interface, 407–408transforming XML data, 410

XmlTextReader objects, 314XPath method, 379XPath property, 408XPathSelect method, 379–380XSD files, 44, 59xsd.exe tool, 59XSLT (Extensible Stylesheet Language

Transformations), 157, 410XslTransform class, 157XSS (cross-site scripting) attacks, 648, 702

XCopy deployment

Z01I621764.fm Page 754 Monday, October 3, 2005 2:04 PM