Online Book Reader

Home Category

Programming Microsoft ASP.NET 4 - Dino Esposito [52]

By Root 5280 0
this behavior by tweaking the values of maxConcurrencyRequestsPerCPU and maxConcurrencyThreadsPerCPU. You can also set both to nonzero values, in which case ASP.NET will manage to honor both of your settings.

The Section


The section is used to configure storage and layout of the user-profiling feature. Basically, each user can be assigned a set of properties whose values are loaded and persisted automatically by the system when the request begins and ends. A profile provider takes care of any I/O activity using a particular data store. The default profile provider, for example, uses the AspNetDb.mdf file and SQL Server Express.

The section has the following schema:

enabled="true|false"

inherits="fully qualified type reference"

automaticSaveEnabled="true|false"

defaultProvider="provider name">

...

...

The enabled attribute indicates whether user profiles are enabled. The default value is true. The set of properties that is associated with each authenticated user is defined in the child element:

Table 3-13 lists the attributes allowed on the Profile property.

Table 3-13. Attributes of the Profile Property

Attribute

Description

allowAnonymous

Allows storing values for anonymous users. It’s false by default.

customProviderData

Contains data for a custom profile provider.

defaultValue

Indicates the default value of the property.

name

Name of the property.

provider

Name of the provider to use to read and write the property.

readOnly

Specifies whether the property value is read-only. It’s false by default.

serializeAs

Indicates how to serialize the value of the property. Possible values are Xml, Binary, String, and ProviderSpecific.

type

The .NET Framework type of property. It is a string object by default.

All properties are packaged in a dynamically created class that is exposed to user code through the Profile property on the HttpContext object. The Inherits attribute allows you to define the base class of this dynamically created profile class. The automaticSaveEnabled attribute specifies whether the user profile should be automatically saved at the end of the execution of an ASP.NET page. (The default is true.) Note that the profile is saved only if the HTTP module in charge of it detects that the profile has been modified.

The element lists all available profile providers. You use this section to register custom providers. The defaultProvider attribute indicates the currently selected provider that pages will use.

The Section


The section configures role management for an ASP.NET application. Role management is carried out by two components: an HTTP module that intercepts incoming requests, and a role provider that retrieves and sets role information for the authenticated user. The provider acts as a proxy for the data store where the role information is stored. All available providers are listed in the child section. A new provider should be added here. The default provider is specified in the defaultProvider attribute. The overall schema of the section is shown here:

cacheRolesInCookie="true|false"

cookieName="name"

cookiePath="/"

cookieProtection="All|Encryption|Validation|None"

cookieRequireSSL="true|false "

cookieSlidingExpiration="true|false "

cookieTimeout="number of minutes"

createPersistentCookie="true|false"

defaultProvider="provider name"

domain="cookie domain">

enabled="true|false"

maxCachedResults="maximum number of role names cached"

...

After the HTTP module receives the role information from the currently selected provider, it usually creates a cookie to cache the information for future requests. All cookie-related attributes you see in the schema configure a different aspect of

Return Main Page Previous Page Next Page

®Online Book Reader