ASP .NET Web Developer s Guide - Mesbah Ahmed, Chris Garrett
.pdf670 Index
settings, retrieval, 220–222 trace tag, usage. See Tracing configuration tag, opening, 215
ConfigurationSettings.appSettings method, 220
ConfigurationSettings.GetConfig method, 220
Connection strings creation, 310–313 placement, 312–313 security, 313
connectionManagement tag, usage. See Connections control
Connections control, connectionManagement tag (usage), 190–191
ConnectionString, 616 Connectivity. See ADO.NET
Console applications, creation, 590–591 Constraints, 127–128
Control.ChildControls Control Collection, 621
ControlCollection, 620
Controls. See Custom controls; Server controls;Validation;World Wide Web
usage. See DataGrid control; DataList control
ControlToCompare property, 128 Cookies, 230, 241
data, encryption/decryption. See Forms
Copy methods, 44
CORBA. See Common Object Request Broker Architecture
Corel, 14
CPAN. See Comprehensive Perl Archive Network (CPAN)
CreatePost method, 606
CreateSummaryTable method, creation, 549–550
CreateThread method, 606 CreateUser, 585, 624
function, 589 CreateUser method, 623 Creator field, 605 CreatorID, 570 credentials subtag, 206 Cross-discipline teams, 4
CSS. See Cascading Style Sheet CT_Email, 505 CT_FirstName, 505
CT_ID, 505, 513 CT_LastName, 505 CT_Password, 505 CType, usage, 602 Currency, datatype, 507 CurrentUser
object, 627 property, 624
Current.Value property, 391 Custom controls, 63
Custom errors definition, customErrors tag (usage), 191–192
Custom server user controls, creation, 161–167
Customer
Admin section, creation, 543–547 administration, 543–547 element, 385, 386
Customer_Id attributes, 385
customErrors tag, usage. See Custom errors definition
CustomValidator, 113, 535, 622
client-side validation function, 120–122
control, 118–120
D
DAL, 319, 332 example, 337
Data
access code, 335
access layer, value retrieval, 312 access object, creation, 579–581 binding, usage, 95–97
caching, 252–257, 266, 281–294 usage, advantages, 292–293
collection, HTML forms (usage), 63–65
connection, creation, 520–521
display, 540–541. See also Formatted data; Repeater control
default column mapping, usage. See DataGrid control
editing capability, providing. See DataGrid control
filters, testing, 559 non-updateable stream, 303 provider, 300, 341 retrieval, 367–369, 537–540 table, 154
types (grouping), System.Collections namespace (usage), 43–44
supplied functionality, 43–44 updating. See Database
Data source, 302, 319
System.Data namespace, usage, 52–53 supplied functionality, 52
data source agnostic namespace, 306 DataAdapter, 302, 303
usage, 538
Database. See MSAccess database; SQL Server database; SQLServer database
access, 51
Index 671
addition, 330–335 books, addition, 541 browsing, 323–330
connection, 319–323, 476 information, 236
connectivity issues, 130 creation. See Access database data, updating, 335–339 deleting, 339–341, 541–542 level, 330
query, usage. See eXtensible Markup Language document
replication, 460
setup. See ADO.NET shopping cart; Message board creation
updating, 542–543 usage, 405–409
Database-driven interactivity, 4 DataBind, 101
Repeater control, interaction, 634 DataBind() method, 111 DataBinded, 540
DataBinds, 632
Databound ListControls, 100 family, 130–161
DataColumn, 306 children, 466 DataColumns, 301 DataControl, 579
Data-enabled ASP.NET pages, 52 DataException, 306
DataGrid, 49
binding, 323. See DataSet contents, 146
control, 387, 540, 561 deleting, 541–542 event, 542
loading, 383
672 Index
paging, providing, 152–154 relational table, 381 resync, 543
sorting, 149–152 tag, 158
UI, 541
updating, 542–543 DataGrid control
data display, default column mapping (usage), 145–146
data editing capability, providing, 157–161
usage, 144–152 DataGridPageChangedEventArgs
parameter, 152, 157 usage, 158
DataItem fields, 132 DataKeyField property, 158
DataList, 314. See also Page-level DataList
binding, 316, 323 control, 157 definition, 142
RepeatColumn property, usage, 139–141
RepeatDirection property, usage, 139–141
DataList control
items, capturing, 141–144 usage, 139–144
DataReader, 303, 305, 325 object, 301
usage, 314 DataReaders, 52
DataRepeater, binding, 323 DataRow, 486, 586, 596, 601
children, 466 creation, 542
CType, usage, 602 passing, 611
DataRows, 301
DataSet, 303, 306, 319, 465, 516. See also XmlDataDocument
allBooks, 551 arrays, 465 creation, 538, 634
DataGrid, binding, 540–541 dsAllBooks, 550
object, 408, 540, 547, 552 property, 378 requirement, 302 returning, 537
RowFilter operations, 466 storage, 547
type, 540
usage, 301, 314, 466–468, 601 view tag, 357
XML document, reading, 408–409 DataSets, 52–53, 361
DataSource object, 497 DataTable, 306, 361, 386
children, 466 filling, 323 returning, 549 value, 546 view, 378
DataType, 486
Datatypes, 507. See also AutoNumber; Currency; Date/Time; Memo; Number; OLE Object;Text; Yes/No
DataView, 306, 541 children, 466 object, 151 usage, 543
DataViews collection, 301
Dates, 40 structures, 38
validating, 126–129 Date/Time, datatype, 508
datetime.maxvalue option, usage, 287 DB2, 327
DCOM. See Distributed Component Object Model
Debug mode, enabling/disabling, 435–436
Debugging. See ASP.NET debugging tools, usage. See Visual Studio .NET
Declaration, 352 decryptionKey attribute, 209
Default column mapping, usage. See DataGrid control
defaultRedirect attribute, 191
Definitions (viewing), object browser (usage), 436
Delete method, 592, 598 DELETE records, 303 Delete Stored procedure, 341 Delete syntax, usage, 339, 340 deleteBoard.aspx, 651 DeletePost method, 597, 599 DeleteThread method, 597 Delphi, 3
Dependency option, usage, 285–287 Depth, 365
Description property, 422
Design Time Control (DTC), 546 Desktop application, 229 DHTML. See Dynamic HTML Dictionary-style interface, 282 Display, 114
Display= “dynamic,” 114 Display= “none,” 114 Display= “static,” 114
Index 673
DisplayBoards subroutine, 630 displayMode, 123 DisplayNode, 376
Dispose, 101
Distributed Component Object Model (DCOM), 443, 448
Distributed Internet Applications (DNA), 5, 9
DLL. See Dynamically linked library
DNA. See Distributed Internet Applications
DNS. See Domain Name System
Document Object Model (DOM), 348, 373
exploration. See eXtensible Markup Language
tree, 374, 376–378, 388
Document Type Definition (DTD), 352–353, 356
DocumentElement, 373 DocumentElement.ChildNodes(0), 373
Documents. See eXtensible Markup Language;Valid XML documents; Well-formed XML documents
components. See eXtensible Markup Language document
creation. See Visual Studio .NET navigation
XPathDocument objects, usage, 392–396
XPathNavigator objects, usage, 392–396
structure. See eXtensible Markup Language
DocumentSource attribute, 398 DOM. See Document Object Model Domain Name System (DNS), 13, 15 doPaging sub-procedure, 152 dotBoard
674 Index
construction, 628 Setup.sql, 573
dotBoardObjects, 590, 614 dotBoardObjects.DataControl class, 646 dotBoardObjects.User object, 615 dotBoardUI, 613, 614
Down-level browsers, 100
Drill-down facilities. See Automatic drill-down facilities
Drop-down list, 303, 646 boxes, 233
DropDownList, 646, 647 control, 645
DropDownLists, usage, 103–106 DSN sources, 176
DTC. See Design Time Control DTD. See Document Type Definition dtProducts, 132, 135
Dynamic compilation, 75
Dynamic HTML (DHTML), 348, 536 Dynamic SQL, 327
Dynamically Linked Library (DLL), 36, 192
file, 78, 81, 83, 577
E
editItemIndex, 314 EditItemIndex, setting, 316 EditItemTemplate, 139 editPost.aspx, 655
Electronic business (E-business), 12 Electronic commerce (E-commerce), 12 Electronic mail (E-mail), 475
address, 474, 569, 638 object, 484 validation, 483
Elements, 353. See also Empty element; Root element
nesting, 355 termination, 355
Element-type node, 368 element-type node, 360 EM. See Enterprise Manager Email, 571
Embedded SQL, 327 statements, 327
Emoticon element, 493 Empty element, 354–355 Enabled, 101 Encryption, 204, 206
keys configuration, machineKey tag (usage), 209–210
End-tag, 353, 355 English-language systems, 180 Enterprise JavaBeans, 9
Enterprise Manager (EM), 510–511, 515, 572, 576
Enum types, 464 Enums, arrays, 464 EOF, 365
ErrorHandling block, 423 ErrorMessage, 114
Errors. See Compilation; Logic errors; Runtime; Syntax errors
definition. See Custom errors definition
handling, 418–426. See also Structured error handling; Unstructured error handling
message, 114, 420, 424 display, 122
Events, 237–239 bubbling, 132
usage, 135–138
capturing. See Repeater control
execution, order, 77 item, 432
usage. See Application; Sessions
Exception, 425. See also OutOfMemoryException; OverflowException
EXEC usp_tblAddress_sel, 326
ExecuteNonQuery method, 335, 339, 341, 579
ExecuteQuery, 530
ExecuteReader, 325 Execution environment, 75
executionTimeout attribute, 194 Expiration policy, 285
option, usage, 287
eXtensible Markup Language Cart (XMLCart)
construction, 553–556 rendering, 559
eXtensible Markup Language Schema Definition (XSD), 356–357, 460
attributes, 478 schema, 359
eXtensible Markup Language (XML), 51
Authority, 362 construction, 476–478 data, 13, 52, 465, 557
representation, 53 data, querying
XPathDocument, usage, 388–396 XPathNavigator, usage, 388–396
Designer, XML document creation. See Visual Studio .NET
DOM, exploration, 373–387 element, 355
files, 15, 52, 285, 484 change, 286
Index 675
files (processing), System.XML namespace (usage), 53–54
supplied functionality, 53–54 format text files, 13 formatting, 174
functions, 553 future, 350
interactions. See Legacy systems node, 362, 560
overview, 348–361 parser, 174, 348 specifications, 350 tags, 619
tree, 364
usage, 405–409. See also Message board creation; .NET framework;World Wide Web services
validation. See Visual Studio .NET XML-based systems, 354 XML-based text files, 8 XML-RPC, 9
eXtensible Markup Language (XML) document, 70, 312. See also Valid XML documents;Well-formed XML documents
appearance, 349 components, 352–355
creation, 350–352. See also Visual Studio .NET
database query, usage, 406–408
generation, XmlTextWriter (usage), 370–373
loading, 378 navigation, 367–369 parsing, 365–367
XmlDocument object, usage, 376–378
XmlTextReader class, usage, 364–369 processing, .NET (usage), 361–364
676 Index
reading, 362–363. See also DataSet
XmlTextReader class (usage), 364–369
storing/processing, 363–364 structure, 360–361
transformation, 400–405. See also HyperText Markup Language
XSLT, usage, 396–405 writing, 362–363
XmlTextWriter class, usage, 370–373
eXtensible Markup Language (XML) XML.NET guestbook
creation, 473 FAQs, 500
functional design requirements, 475–478
interface, advanced options, 490–497 introduction, 474–475
records, addition, 478–488 solutions, 498–499 viewing, 488–490
eXtensible Stylesheet Language Transformations (XSLT), 348, 362, 396, 549
code, 401–403 file, 401
style sheet, 397
usage. See eXtensible Markup Language document
F
Factorial, value, 426 Failure point, 27 File locking, 488
File Transfer Protocol (FTP), 5, 16, 231 fileControl.PostedFiled.SaveAs, 93 Filestream, 495
Finally block, 425 firehose Recordset, 303 Firewalls, 448 FirstChild, 373 FirstName, 571 FirstRecord, 558
Floating point numbers, 38 Floating-point numbers, 39–40 Font, 101
Footer template, 132, 133 FooterTemplate, 132 ForeColor, 101
forecolor property, 122 /form, 130–161
Formatted data, display, 146–149 Formatting, 370
Formatting-related HTML elements, 139
FormBase.vb, 614 Forms. See Online forms
authentication cookie data, encryption/decryption, 209
controls. See World Wide Web objects, 482
usage. See Data collection forms subtag, 205, 206 Form-type server controls, 62 Forward-only basis, 362–363 Foundation class libraries, 12
Fragment caching, 266, 267, 277–281, 294
usage, advantages, 281 fragment_cache.aspx, 279 FrontPage, 5
FTP. See File Transfer Protocol Functionality. See Supplied functionality
G
Generated template code, 455 GET, 16, 192
query string parameter, 270 requests, 17
GetAllBooks, 513 GetAllCat, 513 GetBoards, 611 getBooks, 519, 540
getBooks.AllBooks Web method, creation, 537–540
getByID function, 316 getCartDescription method, 556 getCategories, 519 getCustomer, 518
GetDataSet, 579 GetElementsByTagName, 380 GetStyleName, 620–621
function, 621 GetValueList method, 97 GetXml, 405
GetXml() method, 552 GetXmlSchema, 405 Global Assembly Cache, 27 Global files, 24
Global support (providing), globalization tag (usage), 180–181
Global unique identifier, 505 Global variables, 233 Global.asa, 313
Global.asax, 228, 234, 250 analysis, 231–232 creation, 245
files, 238
globalization tag, usage. See Global support
grossWage property, 164
Index 677
Guestbook. See eXtensible Markup
Language XML.NET guestbook
Guests, 581
GUIs, 478
H
HasAttributes property, 365 HasChildNodes, 373 HashTable, 95
HasValue, 365 Header
information, 17 template, 133
HeaderStyle property, 147 HeaderTemplate, 132 headerText, 123
Height, 101 Hidden fields, 69
HTML. See HyperText Markup Language
/html, 130–161
/HTML tag, cache remove method (usage), 292
HTMLAnchor, 47 object, 36
HtmlAnchor control, 651 usage, 88, 89
HtmlButton control, usage, 91–93 HtmlCheckBox control, usage, 98–99 HtmlImage control, usage, 91–93 HtmlInputButton, 91
HtmlInputFile control, usage, 93–95
HtmlInputRadioButton control, usage, 98–99
HtmlInputText control, usage, 90–91 HTMLInputTextBox object, 36 HtmlSelect control
binding, 111
678 Index
usage, 95–97 HtmlTable
construction, 89 control, usage, 88–90
HtmlTextArea control, usage, 90–91 HTTP. See HyperText Transfer Protocol HttpApplication class, 46 HttpCachePolicy class, 46
methods, 269 usage, 275–277 httpHandlers, 192
tag, usage. See Requests mapping
httpModules tag, usage. See HyperText Transfer Protocol modules configuration
HttpRequest object variables, 45 HttpResponse object variables, 45 HttpResponse.Cache property, 269 httpRuntime tag, 194
usage. See Runtime options HttpServerUtility object, 45 HTTP_USER_AGENT variable, 184 HyperLink controls, usage, 110–111 Hyperlinks, display, 88
HyperText Markup Language (HTML), 4, 53, 212, 557. See also Dynamic HTML
anchor tag, 655 code, 482
controls, 47, 75, 558 usage, 66–67
counterparts, 48 display, 26 document, 64, 348
XML document transformation, 397–399
elements, 62, 87, 93, 95. See also Formatting-related HTML elements
form element, 64
usage. See Data validation, 535
functions, 488
head/body information, 257 HTML-user interface controls, 36 layout techniques, 535
markup, 20 metatag, 232 page, 47 rendering, 303
server controls, 62, 102 usage, 87–100
Web controls, contrast, 100 string, 637
table, 133, 397 tables/lists, 48 version 3.2, 100 version 4.0, 100 view, 453
HyperText Transfer Protocol (HTTP), 350, 443
connections, 518
data transmission, 462, 465 header, 230
value, 273
HTTP-header client-side implementation, 8
message, 63, 65 methods, 16 modules, 200
configuration, httpModules tag (usage), 193–194
processing, 194 protocol, 67
reponse information, 45 request, 18, 267, 281
header, 17 traffic, 448 usage, 461
I
IBM, 7
IconfigurationSectionHandler interface, 212
IDC. See Internet Database Connector technology, 10
@@IDENTITY function, 330 selection, 332 @@identity, 509
identity tag, usage. See Application If statements, 27, 637 IHttpHandler, 192 IhttpHandlerFactory, 192
IIS. See Internet Information Server IL. See Common Language Runtime Image selection, 494
ImagePath, 130 Images
folder, 92 manipulation, 491–495
img (element), 92 Imports keyword, 306 In AddItem, 560
In Checkout, 560
In Page_Load(), 559
In RemoveItem, 560 In showCart(), 560
In showCatalog(), 559–560 InferXmlSchema, 405 inflate method, 588, 611
Inheritance, 75. See also Configuration
.ini files, 174
Index 679
Init, 101 init(), 529, 530
InitCatalog method, creation, 550 Initialization code, 495 InitializeComponent() method, 521 InitializeThreads method, 599–601 InkCreateBoard, 649
Inline coding, 77
In-memory relational database, 301 InnerText, 373
In-Page Code, 63
In-page coding, contrast, 77. See also Code-behind
Input/Output, 335 INSERT records, 303 Insurance-related data, 103 Int16 variable, 419
Int32 variable, 419 Integers, 38
data types, 39 number, 250
Integral numbers, 38, 39
Intermediate Language (IL). See Common Language Runtime
Internet Database Connector (IDC), 3
Internet Information Server (IIS), 2–3, 10, 18
application parameters, 228 environment, 63
infancy, 5 usage, 266, 450 version 5, 8, 10
Internet Server Application Programming Interface (ISAPI), 3–5, 10
Internet Service Provider (ISP), 19 Intrinsic state methods, 220 IsAdmin, 571, 648