Pro ASP.NET 3.5 Server Controls and AJAX Components
9781590598658, 1590598652, 9781430204626, 1430204621
Listen, I buy technical manuals the way some women buy shoes. I love reading and learning this stuff to stay ahead of th
258
38
12MB
English
Pages 766
Year 2008
Report DMCA / Copyright
DOWNLOAD PDF FILE
Table of contents :
Pro ASP.NET 3.5 Server Controls and AJAX Components......Page 1
Contents at a Glance......Page 7
Contents......Page 9
About the Authors......Page 19
About the Technical Reviewer......Page 21
Acknowledgments......Page 23
How This Book Is Structured......Page 25
Contacting the Authors......Page 26
The Heart and Soul of ASP.NET......Page 27
A .NET Framework fiHelo, WorldflWeb Form......Page 28
Control Properties......Page 33
Control Events......Page 35
The Web Page As a Control Tree......Page 37
The Root Controls......Page 39
System.Web.UI.HtmlControls Namespace......Page 40
An HTML Controls Demonstration......Page 42
The System.Web.UI.WebControls Namespace......Page 46
A Simple Controls Demonstration......Page 47
A List Controls Demonstration......Page 51
Rich Controls......Page 54
A Rich Controls Demonstration......Page 55
An XML Control and XSLT Demonstration......Page 57
Validation Controls......Page 60
A Validation Controls Demonstration......Page 61
Web Controls vs. HTML Controls......Page 66
Summary......Page 67
Packaging Content in ASP.NET......Page 69
Inheritance......Page 70
User Controls......Page 71
Custom Server Controls......Page 75
Building a User Control......Page 78
The MenuUserControl User Control......Page 79
Using the MenuUserControl User Control......Page 80
The TableUserControl User Control......Page 81
Using the TableUserControl User Control......Page 83
Which Base Class?......Page 86
Rendered or Composite Control?......Page 87
Using the MenuCustomControl Server Control......Page 89
The TableCustomControl Server Control via Rendering......Page 91
Using the Custom Table Controls......Page 98
Inheriting from an Existing Server Control......Page 101
ASP.NET AJAX UpdatePanel Server Control......Page 104
ASP.NET AJAX UpdateProgress Server Control......Page 105
What’s an Attribute?......Page 108
Common Design-Time Attributes......Page 109
Summary......Page 110
ASP.NET Request-Processing Architecture......Page 111
HttpHandler......Page 113
The Context Object......Page 114
ASP.NET and Client-Side State Management......Page 115
Cookies......Page 116
HTML Hidden Variables......Page 117
ViewState......Page 119
The StateBag Class and the IStateManager Interface......Page 120
Ease of Use......Page 121
A Client State Workshop......Page 122
Reading the Client State......Page 126
Getting the URL State......Page 127
The StatelessLabel Server Control......Page 128
The StatefulLabel Server Control......Page 129
Comparing the Labels......Page 130
Setting the Label Control State......Page 132
Testing Control ViewState......Page 133
The IPostBackDataHandler Interface......Page 134
The Textbox Control......Page 135
Using the Textbox Control......Page 137
ViewState Is Now Application User State......Page 141
New TextBox3d Demonstration Web Form......Page 142
Adding Control State to TextBox3D......Page 144
Summary......Page 147
Customizing the Appearance of Controls......Page 149
Styling Using Cascading Style Sheets......Page 150
Style Properties and Visual Studio......Page 153
WebControl and Control Styling......Page 156
WebControl’s ControlStyle Property......Page 157
WebControl Top-Level Style Properties......Page 158
The Style Property......Page 159
A Styled Label Control......Page 160
The AddAttributesToRender() Method......Page 161
A Styled TextBox Control......Page 162
The Web Control Style Web Form......Page 165
Styles, HTML 3.2, and Down-Level Browsers......Page 173
The Styled InputBox Control......Page 175
LabelStyle and TextBoxStyle......Page 178
Customizing ViewState......Page 179
Rendering the Output......Page 180
The InputBox Style Web Form......Page 184
Applying the LabelStyle and TextBoxStyle Settings......Page 189
The CursorStyle Enumeration......Page 192
The FancyLabel Control......Page 197
Rendering the FancyLabel Control......Page 198
The FancyLabel Style Web Form......Page 200
The StyleCollection Class......Page 204
Summary......Page 207
The Need for Events in ASP.NET......Page 209
The .NET Framework Event Model......Page 211
Delegates......Page 212
Working with Delegates......Page 213
System.EventHandler Delegate......Page 216
Enhancing the TextBox Control with a TextChanged Event......Page 217
Using the TextBox Control on a Web Form......Page 220
Creating a TextChangedEventArgs Class......Page 224
Creating a TextChangedEventHandler Delegate......Page 225
Adding an Event to the CustomEventTextBox Control......Page 226
Using the CustomEventTextBox Control on a Web Form......Page 229
Rendering the Button......Page 233
Exposing a Click Event and the Events Collection......Page 235
Exposing the Command Event......Page 237
Capturing the Postback via IPostBackEventHandler......Page 239
Using the SuperButton Control on a Web Form......Page 243
Building the Pager Child Control Hierarchy......Page 250
Defining the PageCommand Event......Page 252
Exposing the PageCommand Event from the Pager Control......Page 253
Capturing the Bubbles via OnBubbleEvent......Page 254
The INamingContainer Interface......Page 255
Using the Pager Control on a Web Form......Page 259
Control Life Cycle......Page 263
Plugging Into the Life Cycle......Page 264
Life Cycle and the HTTP Protocols GET and POST......Page 265
TrackViewState Method......Page 271
Render Method......Page 272
HTTP POST Request via Postback......Page 273
LoadPostBackData Method......Page 275
Summary......Page 276
Customized Control Content......Page 279
The ParseChildren Attribute......Page 280
A Menu Control with Templates......Page 282
The Template Properties......Page 283
Creating the Header Section......Page 284
Creating the Hyperlink Section......Page 286
Viewing the TemplateMenu Control......Page 292
The TagDataMenu Control......Page 294
The BuilderMenuControl......Page 299
Viewing the Tag Parsing Menu Controls......Page 304
Summary......Page 306
Server Control Data Binding......Page 307
DataBinding Base Class Options......Page 308
The Repeater Control......Page 309
The RepeaterItem Container Control......Page 310
Command Events and the RepeaterItem Control......Page 312
The Repeater Control Architecture......Page 315
Repeater Control Event Management......Page 328
Data Binding with the Repeater Control......Page 338
Advanced Interaction with the Repeater Control......Page 344
The Dynamic Templates Web Form......Page 349
Implementing the ITemplate Interface......Page 355
CompositeDataBoundControl......Page 360
The EnhancedSpreadsheetControl......Page 361
Summary......Page 370
Client-Side Script Server Control Scenarios......Page 373
Handling Client-Side Events......Page 374
The Click Web Form......Page 376
Handling Mouse Events for Image Rollovers......Page 378
JavaScript Detection......Page 379
Rendering Client Script Code......Page 380
Rendering the HTML Code......Page 383
The RolloverImage Web Form......Page 388
Analyzing the Rollover HTML Output......Page 391
The FormConfirmation Control......Page 392
The ConfirmedLinkButton Control......Page 393
The Confirm Web Form......Page 395
The UpDown Server Control......Page 400
Key Properties: MinValue, MaxValue, Increment, and Value......Page 401
Preparing the Script for Rendering......Page 403
Creating the Child Controls......Page 407
The ValueChanged Event......Page 408
Retrieving the Data......Page 409
Handling Child Control Events......Page 410
The UpDown Web Form......Page 418
Client Callbacks......Page 421
The Callback Web Form......Page 422
The StockNews Callback Control......Page 430
Summary......Page 438
ASP.NET AJAX......Page 439
SimpleUserControlAJAX Demonstration......Page 440
ASP.NET AJAX Extensibility......Page 442
The GetScriptReferences Method......Page 443
The GetScriptDescriptors Method......Page 444
HoverButton Example......Page 445
The TextCaseExtender Control......Page 452
The TextCaseBehavior Client-Side Component......Page 454
The HighlightedHyperLink ASP.NET AJAX Server Control......Page 458
The HighlightedHyperlink Client-Side Component......Page 461
Summary......Page 466
Web-Part-Based Web Site Development......Page 467
Web Part Infrastructure......Page 468
Creating Web Parts......Page 469
The Server Controls......Page 470
Converting to WebPart Controls......Page 479
The WebPartPageController Server Control......Page 481
Wiring Up the Page......Page 489
Web Part Development Tips......Page 502
Nonmobile Adaptive Behavior......Page 503
Control Adapters......Page 504
The PageAdapter Base Class......Page 505
The WebControlAdapter Base Class......Page 506
Working in Visual Studio 2008......Page 508
Mobile Controls Quick Primer......Page 509
System.Web.UI.MobileControls Controls......Page 510
Browsing Mobile Web Forms......Page 513
Customizing and Implementing Mobile Controls......Page 514
The StyleSheet Control......Page 515
The StyleSheetExternal Mobile Web Page......Page 516
The DeviceSpecific.aspx Mobile Web Page......Page 517
Templates......Page 518
The DeviceSpecific and Choice Elements......Page 519
Filter Attribute and deviceFilters Configuration......Page 520
MobileCapabilities, browserCaps, and Device Update 2......Page 521
Custom Device Adapters and Mobile Controls......Page 522
New Capabilities in MobileCapabilities......Page 523
User Controls......Page 528
Miniaturizing the Header and Footer......Page 529
Custom Controls......Page 530
Device Adapters......Page 531
Mobile Control and Adapter Interaction......Page 533
Managing ViewState......Page 535
Inheriting from MobileControl......Page 537
The MCTextBox Control......Page 538
The HTML Device Adapter......Page 541
The WML Device Adapter......Page 543
Testing MCTextBox......Page 545
Summary......Page 547
Design-Time Architecture......Page 549
Environment Services Overview......Page 550
Customizing Component Behavior......Page 552
The TitledThumbnail Control......Page 553
The TitledThumbnail Control at Design Time......Page 558
The Properties Window......Page 559
The LocationConverter Class......Page 564
The ImageMetaDataConverter Class......Page 568
The SimpleTextEditor Editor......Page 571
The Collection Editor......Page 574
The Component Editor Dialog Box......Page 576
The Component Editor Class......Page 581
Custom Designers......Page 584
The Control Designer and Designer Verbs......Page 586
The Templated Control Designer......Page 590
The Data-Bound Control Designer......Page 594
The RepeaterDesigner Class......Page 595
Debugging Design-Time Development......Page 599
Summary......Page 600
The Problem Domain......Page 603
The Live Search Web Service......Page 604
Web Services Description Language and .NET Web Service Proxies......Page 605
Creating the Control Library Project......Page 609
Bin Directory or Global Assembly Cache Deployment......Page 610
Additional Assembly Attributes......Page 611
Crafting the Configuration Section XML......Page 612
Registering the Configuration Section......Page 613
Building a Configuration Section Handler Class......Page 615
Wrapping the Web Service Proxy in a Utility Method......Page 617
Designing the Control Architecture......Page 619
The Search Control......Page 621
Handling the Search......Page 622
The Result Control......Page 630
The ResultItem Control......Page 631
The Blank Scenario......Page 635
The DataBind Scenario......Page 636
Creating a Control Hierarchy for Data Binding or Postback......Page 637
Creating ResultItem Controls......Page 640
Creating the Child Pager Control......Page 642
Managing Paging......Page 643
Styling the Result Control......Page 644
The Pager Control......Page 669
Creating the Pager Results......Page 670
Creating the Pager’s Previous Button......Page 671
Creating the Pager’s Bar Pages......Page 672
Creating the Pager’s Next Button......Page 673
Ensuring Pager’s Style Rendering......Page 674
Summary......Page 681
Designers and Dummy Data Source......Page 683
Template Support in the Result Control......Page 692
Toolbox Image Icons......Page 696
The Default Look and Feel......Page 697
Customizing the Live Search Controls’ Appearance......Page 700
Licensing Support......Page 703
The RsaLicense License......Page 704
License Cryptography......Page 707
Generating the License......Page 709
The RsaLicenseDataAttribute Custom Attribute......Page 711
Adding Licensing to the Search and Result Controls......Page 712
The RsaLicenseProvider Class......Page 714
The CultureInfo Class......Page 722
The ResourceManager Class......Page 723
Culture Types and Localizing Resource Files......Page 726
Satellite Assemblies and Resource Fallback......Page 728
Setting Thread Culture in the Global.asax File......Page 730
Viewing a Localized Web Form......Page 731
Code Analysis for Managed Code......Page 735
Documentation......Page 737
Summary......Page 738
Index......Page 739