Home Page Icon
Home Page
Table of Contents for
III. Maintaining and Configuring a Web Application
Close
III. Maintaining and Configuring a Web Application
by Amit Kalani
MCAD/MCSD Training Guide (70-315): Developing and Implementing Web Applications with Visual C# and Visual Studio .NET
Copyright
Dedication
A Note from Series Editor Ed Tittel
About the Author
Acknowledgments
We Want to Hear from You!
How to Use This Book
Chapter Opener
Instructional Features Within the Chapter
Extensive Review and Self-test Options
Introduction
How This Book Helps You
Organization
Instructional Features
Extensive Practice Test Options
Final Review
What the Developing and Implementing Web Applications with Microsoft Visual C# .NET and Microsoft Visual Studio .NET Exam (70-315) Covers
Creating User Services
Creating and Managing Components and .NET Assemblies
Consuming and Manipulating Data
Testing and Debugging
Deploying a Web Application
Maintaining and Supporting a Web Application
Configuring and Securing a Web Application
What You Should Know Before Reading This Book
Hardware and Software You'll Need
Advice on Taking the Exam
Study and Exam Prep Tips
Study Tips
Study Strategies
Macro and Micro Study Strategies
Active Study Strategies
Common Sense Strategies
Pretesting Yourself
Exam Prep Tips
The MCP Exam
Exam Forms
Fixed-Form Exams
Adaptive-Form Exams
The Adaptive-Exam Process
New Question Types
Simulation Questions
A Typical Simulation Question
Putting It All Together
More Preexam Preparation Tips
Tips for the Exam Session
Tips for Fixed-Form Exams
Tips for Adaptive Exams
Tips for Simulation Questions
Final Considerations
I. Developing Web Applications
1. Introducing Web Forms
Introduction
Key Concepts
An Overview of the .NET Framework
The Common Language Runtime
The Framework Class Library
An Overview of the Development Tools
The .NET Framework SDK
ASP.NET Web Matrix Project
Visual Studio .NET
Understanding Classes, Inheritance, and Namespaces
Classes
Inheritance
Namespaces
Introduction to ASP.NET
Advantages of ASP.NET
Creating an ASP.NET Page
Understanding the ASP.NET Page Execution
The Page Class
Stages in Page Processing
ASP.NET Directives
The Page Directive
Event Handling
Elements of Event Handling
Event Arguments
Event Handlers
Delegates
Events
Event Raising Methods
Publishing and Subscribing to an Event
Publishing an Event
Subscribing to an Event
Event Handling in ASP.NET
Handling Events by Overriding the Virtual, Protected Method of the Base Class
Handling Events by Attaching a Delegate
Handling Events of the Page Class Through AutoEventWireup
Separating User Interface from Business Logic
Using Code-Behind Without Precompilation
Using Code-Behind with Precompilation
Creating a Web Form Using Visual Studio .NET
Analyzing the User Interface Piece of a Web Form
Analyzing the Business Logic Piece of a Web Form
Chapter Summary
Apply Your Knowledge
Exercises
1.1. Creating and Managing Virtual Directories
1.2. Using Reflection to Find Information About the Page Class
1.3. Using MSIL Disassembler (ildasm.exe)
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
2. Controls
Introduction
HTML Controls
HTML Server Controls
The Classes in the System.Web.UI.HtmlControls Namespace
The HtmlForm Class
Event Handling for HTML Server Controls
Server-Side Event Handling for HTML Server Controls
Client-Side Event Handling for HTML Server Controls
Web Server Controls
Common Web Server Controls
The Label Control
The TextBox Control
The Image Control
The CheckBox and RadioButton Controls
The Button, LinkButton, and ImageButton Controls
Event Handling for Web Server Controls
Client-Side Event Handling for Web Server Controls
The List Controls
The PlaceHolder and Panel Controls
The Table, TableRow, and TableCell Controls
The AdRotator Control
The Calendar Control
User Input Validation
Controls That Can Be Validated
The BaseValidator Class
Using the Page.Validate() Method and Page.IsValid Property
Client-Side Validation for ASP.NET Server Controls
Validation Web Server Controls
The RequiredFieldValidator Control
The RegularExpressionValidator Control
The RangeValidator Control
The CompareValidator Control
The CustomValidator Control
The ValidationSummary Control
Cascading Style Sheets
Using Style Sheets with Web Forms
Creating Styles to Format Web Controls
Chapter Summary
Apply Your Knowledge
Exercises
2.1. Finding the click position in an Image
2.2. Registering Client-Side Script
2.3. Using the Xml Control
2.4. Change Password Screen
2.5. Using the HyperLink Control
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
3. Implementing Navigation for the User Interface
Introduction
Roundtrip and Postback
The IsPostBack Property
The SmartNavigation Property
ASP.NET Intrinsic Objects
The HttpRequest Object
The HttpResponse Object
The HttpServerUtility Object
ASP.NET Application
The global.asax File
Global Event Handlers
Application and Session Level Events
Per-Request Events
State Management
Client-Side Techniques for State Management
Query Strings
Cookies
Hidden Fields
View State
View State for Postback Controls
View State for Non-postback Controls
View State for Page-Level Values
Disabling View State
Protecting View State
Choosing a Client-Side State Management Technique
Server-Side Techniques for State Management
Session State
Comparing ASP.NET Session State with ASP
Using Session State
Application State
Navigation Between Pages
The Response.Redirect() Method
The Server.Transfer() Method
The Server.Execute() Method
Chapter Summary
Apply Your Knowledge
Exercises
3.1. Using Session State to Create a Shopping Cart
3.2. Creating a Wizard-like User Interface
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
4. Error Handling for the User Interface
Introduction
Understanding Exceptions
Handling Exceptions
The try Block
The catch Block
The throw Statement
The finally Block
Creating and Using Custom Exceptions
Managing Unhandled Exceptions
Using Custom Error Pages
Setting a Custom Error Page for a Specific Page
Using Error Events
Using the Page.Error Event
Using the Application.Error Event
Chapter Summary
Apply Your Knowledge
Exercises
4.1. Emailing Unhandled Exceptions
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
5. Data Binding
Introduction
Bind Data to the User Interface
Simple Data Binding
Binding to Public Members
Binding to Control Properties
Complex Data Binding
Binding to a DropDownList or ListBox Control
Binding to a CheckBoxList or RadioButtonList Control
Binding to a DataGrid Control
The DataBind() Method
Using the Data Form Wizard
Building a Single-Table Data Form
Building a Multiple-Table Data Form
Transform and Filter Data
Using Server Explorer
Adding a Data Connection
Object Design from Server Explorer
Drag and Drop from Server Explorer
Filtering Data
Filtering with a DataView Object
Filtering at the Database Server
Transforming Data
Using Controls to Display Data
The Repeater Control
The DataList Control
Editing Data with a DataList Control
Chapter Summary
Apply Your Knowledge
Exercises
5.1. Using Simple Data Binding to Display Information from an Array
5.2. Use Simple Data Binding to Display Information From a Database
5.3. Use Complex and Simple Data Binding With a DropDownList Control
5.4. Create a Master-Detail Data Form
5.5. Using a DataView Object to Filter Data at Runtime
5.6. Use SelectedIndex in a DataList Control
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
6. Consuming and Manipulating Data
Introduction
Access and Manipulate SQL Server Data
Using Ad Hoc Queries
Running Queries
Using the Visual Studio .NET IDE
Using osql
Using the SQL Query Analyzer
Using a Visual C# .NET Application
The SELECT Statement
The INSERT Statement
The UPDATE Statement
The DELETE Statement
Using Stored Procedures
Creating a Stored Procedure
Running Stored Procedures from the .NET Framework
Using Parameters in Stored Procedures
Using the @@IDENTITY Variable
Access and Manipulate Data
Working with Disk Files
Using the File Class
Using Streams and Backing Stores
Using the FileStream Class
Using the StreamReader and StreamWriter Classes
Using the BinaryReader and BinaryWriter Classes
The ADO.NET Object Model
Data Providers and Their Objects
The SqlConnection Object
The SqlCommand and SqlParameter Objects
The SqlDataReader Object
The SqlDataAdapter Object
The DataSet Objects
The DataTable Object
The DataRelation Object
The DataRow Object
The DataColumn Object
The DataView Object
Using DataSet Objects
Populating a DataSet Object from a Database
Moving Around in DataSet Objects and Retrieving Data
Using Strongly Typed DataSet Objects
Using DataSet Objects with Multiple Tables
Finding and Sorting Data in DataSet Objects
Editing Data with ADO.NET
Updating Data
Adding Data
Deleting Data
Editing with a DataGrid Control
Using XML Data
Understanding XML
Using the XmlNode, XmlDocument, XmlTextReader, and XmlTextWriter Classes
Treating XML as Relational Data
Handle Data Errors
Handling Database Errors
Handling Multiuser Errors
Chapter Summary
Apply Your Knowledge
Exercises
6.1. Preselecting Data by Using Parameterized Stored Procedures
6.2. Transferring Database Data to a Disk File
6.3. Using Transactions with ADO.NET
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
7. Creating and Managing .NET Components and Assemblies
Introduction
Creating and Using .NET Components
Creating a Component
Creating and Using Web User Controls
Creating a Web User Control
Loading Web User Controls Programmatically
Creating and Using Web Custom Controls
Creating a Composite Control
Creating a Derived Control
Creating a Control from Scratch
Custom Control Choices
Creating and Managing .NET Assemblies
Single-file and Multifile Assemblies
Static and Dynamic Assemblies
Private and Shared Assemblies
Satellite and Resource-Only Assemblies
Chapter Summary
Apply Your Knowledge
Exercises
7.1. Events from a Composite Control
7.2. Getting Types in an Assembly
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
8. Web Services
Introduction
Understanding Web Services
SOAP
Disco and UDDI
WSDL
Invoking Your First Web Service
Creating Web Services
Creating a Web Service Project
Testing the Web Service Project
Discovering Web Services
Disco and UDDI
Using the Web Services Discovery Tool (disco.exe)
Instantiating and Invoking Web Services
Creating Proxy Classes with the Web Services Description Language Tool (wsdl.exe)
Using Web References
Testing a Web Service
Chapter Summary
Apply Your Knowledge
Exercises
8.1. Calling a Web Service Asynchronously
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
9. Globalization
Introduction
Understanding Localization and Globalization
The Localization Process
What Should Be Localized?
Implementing Localization for the User Interface
Understanding Cultures
About Culture Codes
The CultureInfo Class
The CurrentCulture and CurrentUICulture Properties
The Invariant Culture
Displaying Localized Information
Setting Culture Properties
Working with Resource Files
Localizing Resources at Runtime
Converting Existing Encodings
Understanding Unicode and Encodings
Converting Encodings
Implementing Mirroring
Understanding Mirroring
Mirroring in .NET
Validating Non-Latin User Input
String Indexing
Comparing and Sorting Data
Chapter Summary
Apply Your Knowledge
Exercises
9.1. Using Localized Calendars
9.2. Retrieving Region Information
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
10. Working with Legacy Code
Introduction
Incorporating Existing Code
Running ASP and ASP.NET Together
Converting ASP Pages to ASP.NET
Using Late-Bound COM Components
Using ActiveX Controls
Using COM Components
Understanding Runtime Callable Wrappers
Using the Type Library Importer Tool (tlbimp.exe)
Using COM Components Directly
Using COM+ Components
Using Platform Invoke
Chapter Summary
Apply Your Knowledge
Exercises
10.1. Finishing the Conversion
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
11. User Assistance and Accessibility
Introduction
Implementing User Assistance
Using a Second Browser Window
Using the Search Pane
Embedding Help
Other User Assistance Alternatives
Implementing Accessibility Features
Understanding Accessible Design Guidelines
The W3C Guidelines
The Section 508 Guidelines
Making a Web Application Accessible
Testing Application Accessibility
Chapter Summary
Apply Your Knowledge
Exercises
11.1. Using Tooltips for User Assistance
11.2. Row and Column Headers for Tables
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
II. Testing, Debugging, and Deploying a Web Application
12. Testing and Debugging a Web Application
Introduction
Testing
Creating a Test Plan
Executing Tests
Unit Testing
Integration Testing
Regression Testing
Testing International Applications
Tracing
Using the TraceContext Class
Using the Trace and Debug Classes
Trace Listeners
Trace Switches
Conditional Compilation
Debugging
Setting Breakpoints and Stepping Through Program Execution
Analyzing Program State to Resolve Errors
Debugging on Exceptions
Debugging a Running Process
Debugging a Remote Process
Debugging the Code in DLL Files
Debugging Client-Side Scripts
Chapter Summary
Apply Your Knowledge
Exercises
12.1. Creating Custom Trace Switch
12.2. Debugging SQL Server Stored Procedures Using Visual C# .NET
12.3. Setting Conditional Breakpoints Using Visual C# .NET
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
13. Deploying a Web Application
Introduction
Deployment Tools
XCOPY Deployment
FTP Deployment
Microsoft Windows Installer
Deploying a Web Application
Creating a Web Setup Project
Customizing Web Setup Projects
Using the File System Editor
Using the Registry Editor
Using the File Types Editor
Using the User Interface Editor
Using the Custom Actions Editor
Using the Launch Conditions Editor
Shared Assemblies
Assigning a Strong Name to an Assembly
Adding an Assembly to the GAC
Using Windows Installer to Add an Assembly to the GAC
Using Windows Explorer to Add an Assembly to the GAC
Using the .NET Framework Configuration Tool to Add an Assembly to the GAC
Using Global Assembly Cache Tool (gacutil.exe) to Add an Assembly to the GAC
Referencing an Assembly from the GAC
How the CLR Locates Assemblies
Delay Signing an Assembly
Delay Signing Using the Assembly Linker Tool
Creating a Merge Module Project
Creating Installation Components
Understanding the Installer Class
Working with Predefined Installation Components
Deploying an Assembly That Contains the Installation Components
Deploying an Installation Component by Using the Web Setup Project
Deploying an Installation Component by Using the Installer Tool (installutil.exe)
Working with Installer Classes
Performing Install-Time Compilation
Cab Project
Scalable and Reliable Deployment
Web Garden
Web Farms
Clusters
Methods of Deployment
Deployment via Removable Media
Web-Based Deployment
Chapter Summary
Apply Your Knowledge
Exercises
13.1. Using Microsoft's Sample .NET Framework Bootstrapper
13.2. Creating Database Script During Installation
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
III. Maintaining and Configuring a Web Application
14. Maintaining and Supporting a Web Application
Introduction
Getting Process Information
Getting Information for a Windows Process
Getting Information for the ASP.NET Worker Processes
Working with Event Logs
Writing to Event Logs
Reading from Event Logs
Working with Performance Counters
Reading Performance Data of Running Processes
Publishing Performance Data
Designing a Web Application for Performance
Chapter Summary
Apply Your Knowledge
Exercises
14.1. Getting Module Information for a Process
14.2. Getting Performance Information
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
15. Configuring a Web Application
Introduction
Configuring a Web Application
Anatomy of a Configuration File
The Configuration File Hierarchy
Reading Configuration Settings from Code
Configuring Security
Configuring Authentication
No Authentication
IIS and ASP.NET Authentication
Authentication Providers
Configuring IIS Authentication
Passport Authentication
Forms Authentication
Configuring Authorization
Implementing Impersonation
Using Role-based Authorization
Using Caching
Output Caching
Fragment Caching
Data Caching
HANDLING SESSION STATE
Using Session State Within a Process
Using Session State Service
Using Microsoft SQL Server to Store Session State
Installing and Configuring Server Services
Installing and Configuring IIS
Installing and Configuring FrontPage Server Extensions
Chapter Summary
APPLY YOUR KNOWLEDGE
Exercises
15.1. Performing Variable Caching Programmatically
15.2. Implementing File-based Dependencies for the Items in Data Cache
Review Questions
Exam Questions
Answers to Review Questions
Answers to Exam Questions
Suggested Readings and Resources
IV. Final Review
Fast Facts Designing and Implementing Web Applications with Microsoft Visual C# .NET and Microsoft Visual Studio .NET
Creating User Services
Create ASP.NET pages
Add and set directives on ASP.NET pages
Separate user interface resources from business logic
Add Web server controls, HTML server controls, user controls, and HTML code to ASP.NET pages
Set properties on controls
Load controls dynamically
Apply templates
Set styles on ASP.NET pages by using cascading style sheets
Instantiate and invoke an ActiveX control
Implement navigation for the user interface
Manage the view state
Manage data during postback events
Use session state to manage data across pages
Validate user input
Validate non-Latin user input
Implement error handling in the user interface
Configure custom error pages
Implement Global.asax, application, page-level, and page event error handling
Implement online user assistance
Incorporate existing code into ASP.NET pages
Display and update data
Transform and filter data
Bind data to the user interface
Use controls to display data
Instantiate and invoke Web service services or components
Instantiate and invoke a Web service
Instantiate and Invoke a COM or COM+ Component
Instantiate and invoke a .NET component
Call native functions by using platform invoke
Implement globalization
Implement localizability for the user interface
Convert existing encodings
Implement right-to-left and left-to-right mirroring
Prepare culture-specific formatting
Handle events
Create event handlers
Raise events
Implement accessibility features
Use and edit intrinsic objects. Intrinsic objects include response, request, session, server, and application
Retrieve values from the properties of intrinsic objects
Set values on the properties of intrinsic objects
Use intrinsic objects to perform operations
Creating and Managing Components and .NET Assemblies
Create and modify a .NET assembly
Create and implement satellite assemblies
Create resource-only assemblies
Create Web custom controls and Web user controls
Consuming and Manipulating Data
Access and manipulate data from a Microsoft SQL Server database by creating and using ad hoc queries and stored procedures
Access and manipulate data from a data store. Data stores include relational databases, XML documents, and flat files; methods include XML techniques and ADO.NET
Handle data errors
Testing and Debugging
Create a unit test plan
Implement tracing
Add trace listeners and trace switches to an application
Display trace output
Debug, rework, and resolve defects in code
Configure the debugging environment
Create and apply debugging code to components, pages, and applications
Provide multicultural test data to components, pages, and applications
Execute tests
Resolve errors and rework code
Deploying a Web Application
Plan the deployment of a Web application
Plan a deployment that uses removable media
Plan a Web-based deployment
Plan the deployment of an application to a Web garden, a Web farm, or a cluster
Create a setup program that installs a Web application and allows for the application to be uninstalled
Deploy a Web application
Add assemblies to the Global Assembly Cache
Maintaining and Supporting a Web Application
Optimize the performance of a Web application
Diagnose and resolve errors and issues
Configuring and Securing a Web Application
Configure a Web application
Modify the web.config file
Modify the Machine.config file
Add and modify application settings
Configure security for a Web application
Select and configure authentication type. Authentication types include Windows Authentication, None, forms-based, Microsoft Passport, Internet Information Services (IIS) authentication, and custom aut
Configure authorization
Configure role-based authorization
Implement impersonation
Configure and implement caching. Caching types include output, fragment, and data
Use a cache object
Use cache directives
Configure and implement session state in various topologies such as a web garden and a web farm
Use session state within a process
Use session state with session state service
Use session state with Microsoft SQL Server
Install and configure server services
Install and configure a Web server
Install and configure Microsoft FrontPage Server Extensions
Practice Exam
Exam Questions
Answers To Exam Questions
V. Appendixes
A. Glossary
B. Overview of the Certification Process
Types of Certification
Certification Requirements
How to Become an MCP
How to Become an MCSA
MCSA Core Exams
MCSA Elective Exams
How to Become an MCSE
MCSE Operating System Exams
MCSE Design Exam
MCSE Elective Exams
How to Become an MCAD
MCAD Core Exams
MCAD Elective Exams
How to Become an MCSD
The MCSD for Microsoft .NET Track
MCSD for Microsoft .NET Track Core Exams
MCSD for Microsoft .NET Track Elective Exams
The MCSD Old Track
MCSD Old Track Core Exams
MCSD Old Track Elective Exams
How to Become an MCDBA
MCDBA Core Exams
MCDBA Elective Exams
How to Become an MCT
C. What's on the CD-ROM
PrepLogic Practice Tests, Preview Edition
An Exclusive Electronic Version of the Text
Complete Code Examples
D. Using the PrepLogic, Preview Edition, Software
The Exam Simulation
Question Quality
The Interface Design
The Effective Learning Environment
Software Requirements
Installing PrepLogic Practice Tests, Preview Edition
Removing PrepLogic Practice Tests, Preview Edition from Your Computer
Using PrepLogic Practice Tests, Preview Edition
Starting a Practice Test Mode Session
Starting a Flash Review Mode Session
Standard PrepLogic Practice Tests, Preview Edition Options
Seeing Time Remaining
Getting Your Examination Score Report
Reviewing Your Exam
Contacting PrepLogic
Customer Service
Product Suggestions and Comments
License Agreement
E. Suggested Readings and Resources
.NET User Assistance
Books
Web Sites
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
13. Deploying a Web Application
Next
Next Chapter
14. Maintaining and Supporting a Web Application
Part III. Maintaining and Configuring a Web Application
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset