- •Contents
- •Introduction
- •Acknowledgments
- •The Goals of ASP.NET 2.0
- •Developer productivity
- •Administration and management
- •Performance and scalability
- •Device-specific code generation
- •Additional New Features of ASP.NET 2.0
- •New developer infrastructures
- •New compilation system
- •Additions to the page framework
- •New objects for accessing data
- •New server controls
- •A New IDE for Building ASP.NET 2.0 Pages
- •The Document Window
- •Views in the Document Window
- •The tag navigator
- •Page tabs
- •Code change status notifications
- •Error notifications and assistance
- •The Toolbox
- •The Solution Explorer
- •Lost Windows
- •Other Common Visual Studio Activities
- •Creating new projects
- •Making references to other objects
- •Using smart tags
- •Saving and importing Visual Studio settings
- •Application Location Options
- •Built-in Web server
- •Web site requiring FrontPage Extensions
- •The ASP.NET Page Structure Options
- •Inline coding
- •New code-behind model
- •New Page Directives
- •New attributes
- •New directives
- •New Page Events
- •Cross-Page Posting
- •New Application Folders
- •\Code folder
- •\Themes folder
- •\Resources folder
- •Compilation
- •The New Data Source Controls
- •The SqlDataSource and GridView Controls
- •Reading data
- •Applying paging in the GridView
- •Sorting rows in the GridView control
- •Defining bound columns in the GridView control
- •Enabling the editing of rows in the GridView control
- •Deleting data from the GridView
- •Dealing with other column types in the GridView
- •Selecting which fields to display in the DetailsView control
- •Using the GridView and DetailsView together
- •Updating, inserting, and deleting rows
- •XmlDataSource Control
- •ObjectDataSource Control
- •SiteMapDataSource Control
- •DataSetDataSource Control
- •Visual Studio 2005
- •Connection Strings
- •Site Maps
- •The PathSeparator property
- •The PathDirection property
- •The ParentLevelsDisplayed property
- •The ShowToolTips property
- •Examining the parts of the TreeView control
- •Binding the TreeView control to an XML file
- •Selecting multiple options in a TreeView
- •Specifying custom icons in the TreeView control
- •Specifying lines used to connect nodes
- •Working with the TreeView control programmatically
- •Applying different styles to the Menu control
- •Menu Events
- •Binding the Menu control to an XML file
- •SiteMap Data Provider
- •SiteMapViewType
- •StartingNodeType
- •SiteMap API
- •Why Do You Need Master Pages?
- •The Basics of Master Pages
- •Coding a Master Page
- •Coding a Content Page
- •Mixing page types and languages
- •Specifying which master page to use
- •Working with the page title
- •Working with controls and properties from the master page
- •Nesting Master Pages
- •Container-Specific Master Pages
- •Event Ordering
- •Caching with Master Pages
- •Using ASP.NET 2.0 Packaged Themes
- •Applying a theme to a single ASP.NET page
- •Applying a theme to an entire application
- •Applying a theme to all applications on a server
- •Removing themes from server controls
- •Removing themes from Web pages
- •Removing themes from applications
- •Creating Your Own Themes
- •Creating the proper folder structure
- •Creating a skin
- •Including CSS files in your themes
- •Having your themes include images
- •Defining Multiple Skin Options
- •Programmatically Working with Themes
- •Themes and Custom Controls
- •Authentication
- •Authorization
- •ASP.NET 2.0 Authentication
- •Setting up your Web site for membership
- •Adding users
- •Asking for credentials
- •Working with authenticated users
- •Showing the number of users online
- •Dealing with passwords
- •ASP.NET 2.0 Authorization
- •Using the LoginView server control
- •Setting up your Web site for role management
- •Adding and retrieving application roles
- •Deleting roles
- •Adding users to roles
- •Getting all the users of a particular role
- •Getting all the roles of a particular user
- •Removing users from roles
- •Checking users in roles
- •Using the Web Site Administration Tool
- •The Personalization Model
- •Adding a simple personalization property
- •Using personalization properties
- •Adding a group of personalization properties
- •Using grouped personalization properties
- •Defining types for personalization properties
- •Using custom types
- •Providing default values
- •Making personalization properties read-only
- •Anonymous Personalization
- •Enabling anonymous identification of the end user
- •Working with anonymous identification events
- •Anonymous options for personalization properties
- •Migrating Anonymous Users
- •Personalization Providers
- •Working with the Access personalization provider
- •Working with the SQL Server personalization provider
- •Using multiple providers
- •Building Dynamic and Modular Web Sites
- •Introducing the WebPartManager control
- •Working with zone layouts
- •Understanding the WebPartZone control
- •Explaining the WebPartPageMenu control
- •Modifying zones
- •Caching in ASP.NET 1.0/1.1
- •Output caching
- •Partial page caching
- •Data caching using the Cache object
- •Cache dependencies
- •ASP.NET 2.0 unseals the CacheDependency class
- •Enabling databases for SQL Server cache invalidation
- •Enabling tables for SQL Server cache invalidation
- •Looking at SQL Server
- •Looking at the tables that are enabled
- •Disabling a table for SQL Server cache invalidation
- •Disabling a database for SQL Server cache invalidation
- •Configuring your ASP.NET Application
- •Adding more than one table to a page
- •Attaching SQL Server cache dependencies to the Request object
- •Attaching SQL Server cache dependencies to the Cache object
- •Customizing the side navigation
- •Examining the AllowReturn attribute
- •Working with the StepType attribute
- •Adding a header to the Wizard control
- •Utilizing Wizard control events
- •Working with images from disk
- •Resizing images
- •Displaying images from streams
- •The MMC ASP.NET Snap-In
- •General
- •Custom Errors
- •Authorization
- •Authentication
- •Application
- •State Management
- •Advanced
- •ASP.NET Web Site Administration Tool
- •Home
- •Security
- •Profile
- •Application
- •Provider
- •Managing the Site Counter System
- •Generics
- •Iterators
- •Anonymous Methods
- •Operator Overloading
- •Visual Basic XML Documentation
- •New Visual Basic Keywords
- •Continue
- •Using
- •Global
- •Index
Administration and Management
Figure 14-6
This particular tab allows you to work with the following items:
Custom error mode: This drop-down list applies custom errors for particular users of the application. The default option is Remote Only. This option ensures that errors are redirected only for users who are on a remote machine. The other settings for this drop-down list include On and Off. On turns on the error redirection for all users, whereas the Off setting turns off the error redirecting for all users.
Default redirect URL: The URL to which all errors are redirected.
Inherited custom errors: All the errors that have been inherited from server defaults. These can be redirections for custom errors that are set in the machine.config file.
Local custom errors: The errors that are set by you for this particular application. Error redirections are set using a name/value pair for Status Code/Redirect URL.
Authorization
The third tab is the Authorization tab. This section of the MMC enables you to authorize specific users or groups for the application (see Figure 14-7).
391
Chapter 14
Figure 14-7
This section enables you to create roles made up of multiple users and/or groups. This dialog contains two items:
Inherited authorization rules: All the authorization rules inherited from server defaults. These can be roles that are established in the machine.config file of the server.
Local authorization rules: The authorization rules that you set for this particular application.
From this dialog, you can add, edit, or remove roles that have been created. If you click the Add button, the dialog shown in Figure 14-8 appears.
You can either allow or deny users access to the application by using the Edit Rule dialog. To use this feature, click the appropriate option in the Rule Type section.
The Verbs section allows you to apply a specific rule to those end users retrieving the page via all possible means (HTTP-POST or HTTP-GET), or to narrow the rule to cover only the specific verbs you want using the second option. Remember that the verb of a request is in how the request is actually made. The possible options specify that the request can be made either using HTTP-POST or HTTP-GET.
The final section, Users and Roles, enables you to choose who you want the rule to be applied to: all users that come to the site, anonymous users only, specific users, or users contained within specific groups.
392
Administration and Management
Figure 14-8
Authentication
The fourth tab in the MMC dialog is the Authentication tab (see Figure 14-9). This tab enables you to modify how your application will authenticate users for later authorization.
Figure 14-9
393
Chapter 14
This dialog contains many options because you can work with the authorization of your end users in so many ways. The following list describes some of the items in this dialog:
Application Settings: This section of the dialog lets you set the authentication mode of your application. The options in the drop-down list include Windows, Forms, Passport, or None. If you select Forms, the grayed-out options (shown in Figure 14-9) are available and enable you to modify all the settings that determine how forms authentication is applied.
Membership: The Membership section enables you to tie the membership process to one of the available data providers available on your server. From this section, you can click the Manage Providers button to add, edit, or remove providers.
Roles: From the Roles section, you can enable role-based management by checking the check box. From here, you can also tie the role management capabilities to a particular data provider.
Clicking the Manage Providers button opens the Provider Settings dialog (see Figure 14-10), which enables you to work with the data providers on the server.
Figure 14-10
From the Provider Settings dialog, you can add, edit, or remove providers. You can also edit the settings of a particular provider. To edit any of the options in the dialog, just highlight the property that you want to change and click the Edit button. A new dialog pops up, which enables you to make changes.
Application
The fifth tab, Application, enables you to make more specific changes to the pages in the context of your application. From this dialog, shown in Figure 14-11, you can change how your pages are compiled and run. You can also make changes to global settings in your application.
394