Contents XSLT Transforms 424 XSLT Transforming between XML Standards Using XML in Visual Basic 2005 other Classes and Interfaces in System. Xml. Xsl 432 ADO.NET 432 ADO. NET and sQL Server 2000s Built-In XML Features XML and sQL Server 2005 Summary 437 Chapter 13: Security in the. NET Framework 2.0 439 Security Concepts and Definitions 440 Permissions in the System Security Permissions Namespace 442 Code Access permissions Role-Based permissions 446 Managing Code Access Permissions 449 Managing Security Policy 454 Figuring the Minimum Permissions Required for Your Application 465 Using Visual Studio to Figure Minimum Permissions 467 Security Tools Dealing with Exceptions Using the Security Exception Class 471 Cryptography Basics 473 Hash Algorithms 474 ummary 495 Chapter 14: Windows Forms 497 The Importance of windows Forms 498 Summary of changes in Windows Forms version 2.0 498 Default Instances of forms Changes in Existing Controls New Controls 500 Replacements for Older Windows Forms Controls The System. Windows Forms Namespace 502 Using Forms 502 Showing Forms via Sub Main 503 Setting the Startup Form Startup Location 504 Form Borders Always on Top- The TopMost Property Owned Forms 505
xv Contents XSLT Transforms 424 XSLT Transforming between XML Standards 429 Using XML in Visual Basic 2005 430 Other Classes and Interfaces in System.Xml.Xsl 432 ADO.NET 432 ADO.NET and SQL Server 2000’s Built-In XML Features 434 XML and SQL Server 2005 436 Summary 437 Chapter 13: Security in the .NET Framework 2.0 439 Security Concepts and Definitions 440 Permissions in the System.Security.Permissions Namespace 442 Code Access Permissions 445 Role-Based Permissions 446 Identity Permissions 449 Managing Code Access Permissions 449 Managing Security Policy 454 Figuring the Minimum Permissions Required for Your Application 465 Using Visual Studio to Figure Minimum Permissions 467 Security Tools 470 Dealing with Exceptions Using the SecurityException Class 471 Cryptography Basics 473 Hash Algorithms 474 Summary 495 Chapter 14: Windows Forms 497 The Importance of Windows Forms 498 Summary of Changes in Windows Forms version 2.0 498 Default Instances of Forms 498 Changes in Existing Controls 499 New Controls 500 Replacements for Older Windows Forms Controls 501 The System.Windows.Forms Namespace 502 Using Forms 502 Showing Forms via Sub Main 503 Setting the Startup Form 503 Startup Location 504 Form Borders 505 Always on Top — The TopMost Property 505 Owned Forms 505 02_575368 ftoc.qxd 10/7/05 10:47 PM Page xv
Contents Making Forms Transparent and Translucent Visual Inheritance Scrollable Forms 509 Forms at runtime 509 Controls 510 Control tab order Control Arrays 511 Automatic Resizing and positioning of Controls 513 FlowLayoutPanel Control 517 TableLayoutPanel Contr Extender Provider controls Advanced Capabilities for Data Entry Validating Data Entry 526 Toolbars and the New ToolStrip Control Common Dialogs Panel and GroupBox Container Controls 38 Summary of Standard Windows. Forms Controls tired controls Using ActiveX Controls other Handy Programming Tips MDI Forms 544 An MDI Example in VB. NET 545 Dialog Forms 547 Summary 549 Chapter 15: Windows Forms Advanced Features 551 Packaging Logic in Visual Controls 552 Developing Custom Controls in. NET Inherit from an Existing Control Build a Composite Control 553 Write a Control from scratch Inheriting from an Existing Contro 554 Overview of the process Adding Additional Logic to a Custom Control Other Useful attributes 559 Defining a Custom Event for the Inherited Control Creating a CheckedListBox that Limits the Number of selected Items 560 The Control and user control base classes The Control class 564 The UserControl class
xvi Contents Making Forms Transparent and Translucent 507 Visual Inheritance 508 Scrollable Forms 509 Forms at Runtime 509 Controls 510 Control Tab Order 511 Control Arrays 511 Automatic Resizing and Positioning of Controls 513 FlowLayoutPanel Control 517 TableLayoutPanel Control 520 Extender Provider Controls 520 Advanced Capabilities for Data Entry 523 Validating Data Entry 526 Toolbars and the New ToolStrip Control 528 Menus 531 Common Dialogs 533 Drag and Drop 535 Panel and GroupBox Container Controls 538 Summary of Standard Windows.Forms Controls 539 Retired Controls 543 Using ActiveX Controls 543 Other Handy Programming Tips 543 MDI Forms 544 An MDI Example in VB.NET 545 Dialog Forms 547 Summary 549 Chapter 15: Windows Forms Advanced Features 551 Packaging Logic in Visual Controls 552 Developing Custom Controls in .NET 552 Inherit from an Existing Control 553 Build a Composite Control 553 Write a Control from Scratch 554 Inheriting from an Existing Control 554 Overview of the Process 554 Adding Additional Logic to a Custom Control 555 Other Useful Attributes 559 Defining a Custom Event for the Inherited Control 560 Creating a CheckedListBox that Limits the Number of Selected Items 560 The Control and UserControl Base Classes 564 The Control Class 564 The UserControl Class 565 02_575368 ftoc.qxd 10/7/05 10:47 PM Page xvi
Contents A Composite UserControl 566 Creating a Composite User Control 567 How Does resize work? Setting a Minimum Size 568 Exposing Properties of Subcontrol Stepping Through the Example 569 Building a Control from Scratch 572 Painting a Custom Control with GDI+ Attaching an Icon for the Toolbox 579 Embedding Controls in Other Controls Summary 582 Chapter 16: Building Web Applications 583 a Web site in Action 583 Setting Up the Environment The helloworld Web Form The Anatomy of a Web Form 590 Single-File Page Model Code- Behind Page Model The Template for Presentation 593 A More Complex Example 594 The Processing Flow of AsP. NeT Web Forms 596 The Controls availlable in web forms The Concept of Server-Side Controls HTML Server Controls ASPNET Server Controls Validation Controls 604 User Controls 605 Events in Web Forms 606 The Web Forms Lifecycle Event Categories Web Forms versus asp 609 Transferring Control among Web Forms A Final Example 611 Summary 625 Chapter 17: ASPNET 2.0 Advanced Features 627 Applications and pages 627 Cross-Page Posting 628 ASP.NET Advanced Compilation
xvii Contents A Composite UserControl 566 Creating a Composite UserControl 567 How Does Resize Work? 568 Setting a Minimum Size 568 Exposing Properties of Subcontrols 568 Stepping Through the Example 569 Building a Control from Scratch 572 Painting a Custom Control with GDI+ 573 Attaching an Icon for the Toolbox 579 Embedding Controls in Other Controls 580 Summary 582 Chapter 16: Building Web Applications 583 A Web Site in Action 583 Setting Up the Environment 584 The HelloWorld Web Form 584 The Anatomy of a Web Form 590 Single-File Page Model 590 Code-Behind Page Model 591 The Template for Presentation 593 A More Complex Example 594 The Processing Flow of ASP.NET Web Forms 596 The Controls Available in Web Forms 598 The Concept of Server-Side Controls 598 HTML Server Controls 600 ASP.NET Server Controls 602 Validation Controls 604 User Controls 605 Events in Web Forms 606 The Web Form’s Lifecycle 607 Event Categories 608 Web Forms versus ASP 609 Transferring Control among Web Forms 611 A Final Example 611 Summary 625 Chapter 17: ASP.NET 2.0 Advanced Features 627 Applications and Pages 627 Cross-Page Posting 628 ASP.NET Advanced Compilation 632 02_575368 ftoc.qxd 10/7/05 10:47 PM Page xvii
Contents Master Pages 534 Creating a Master Page Creating the Content Page 637 Declaring the Master Page Application-Wide 641 Providing Default Content in Your Master Page Data-Driven Applications 642 Using the gridview and sqlData Source Controls Allowing for Editing and Deleting of Records with the Gridview 648 Dont stop There 652 Navigation Using the SiteMapPath Server Control Menu server Control The tree view Server Control Membership and role Management 661 Personalization 665 Configuring ASPNET 666 Summary 668 Chapter 18: Assemblies 671 Assembli 672 The manifest 673 The Identity Section 675 Referenced Assemblies 677 Assemblies and Deployment 678 Application-Private Assemblies 678 Shared Assemblies 679 Versioning Issues 681 xecution 682 Self-Describi ng Version Policies Configuration Files Dynamic Loading of Assemblies The Assembly Class 687 Putting Assemblies to Work 689 Summary Chapter 19: Deployment 691 Application Deployment 692 Why Is Deployment Easier in. NET? 692 riii
xviii Contents Master Pages 634 Creating a Master Page 635 Creating the Content Page 637 Declaring the Master Page Application-Wide 641 Providing Default Content in Your Master Page 642 Data-Driven Applications 642 Using the GridView and SqlDataSource Controls 643 Allowing for Editing and Deleting of Records with the GridView 648 Don’t Stop There! 652 Navigation 653 Using the SiteMapPath Server Control 654 Menu Server Control 656 The TreeView Server Control 657 Membership and Role Management 661 Personalization 665 Configuring ASP.NET 666 Summary 668 Chapter 18: Assemblies 671 Assemblies 672 The Manifest 673 The Identity Section 675 Referenced Assemblies 677 Assemblies and Deployment 678 Application-Private Assemblies 678 Shared Assemblies 679 Versioning Issues 681 Application Isolation 681 Side-by-Side Execution 682 Self-Describing 682 Version Policies 682 Configuration Files 684 Dynamic Loading of Assemblies 687 The Assembly Class 687 Putting Assemblies to Work 689 Summary 689 Chapter 19: Deployment 691 Application Deployment 692 Why Is Deployment Easier in .NET? 692 02_575368 ftoc.qxd 10/7/05 10:47 PM Page xviii
Contents XCOPY Deployment Using the Windows Installer Visual Studio. NET Deployment Projects 695 Project Template Creating a Deployment Project Walkthroughs Modifying the Deployment Project 710 Project Properties 711 The File System Editor 714 The Registry Editor The File Types Editor 722 The Custom Actions editor 726 The Launch Conditions editor Building 732 Internet Deployment of windows Applications 733 No-Touch Deployment ClickOnce Deployment 735 Custom Deployment Opti Summary 745 Chapter 20: Working with Classic COM and Interfaces 747 Classic coM 748 CoM and net in Practice 749 A Legacy Component 749 T Application ng It All Out 754 ng TIblmp Directly Late Binding 756 ActiveX controls 761 A Legacy ActiveX Control A. NET Application, Again 763 rying It All Out, Again Using. NET Components in the CoM World 766 A. NET Component 767 TIbExp 772 Summary 772
xix Contents XCOPY Deployment 694 Using the Windows Installer 694 Visual Studio .NET Deployment Projects 695 Project Templates 696 Creating a Deployment Project 698 Walkthroughs 698 Modifying the Deployment Project 710 Project Properties 711 The File System Editor 714 The Registry Editor 719 The File Types Editor 722 The User Interface Editor 723 The Custom Actions Editor 726 The Launch Conditions Editor 729 Building 732 Internet Deployment of Windows Applications 733 No-Touch Deployment 733 ClickOnce Deployment 735 Custom Deployment Options 745 Summary 745 Chapter 20: Working with Classic COM and Interfaces 747 Classic COM 748 COM and .NET in Practice 749 A Legacy Component 749 The .NET Application 752 Trying It All Out 754 Using TlbImp Directly 755 Late Binding 756 ActiveX Controls 761 A Legacy ActiveX Control 761 A .NET Application, Again 763 Trying It All Out, Again 766 Using .NET Components in the COM World 766 A .NET Component 767 RegAsm 769 TlbExp 772 Summary 772 02_575368 ftoc.qxd 10/7/05 10:47 PM Page xix