Online Book Reader

Home Category

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

By Root 5277 0
named userIsOnlineTimeWindow specifies how long a user can be idle and still be considered online. The interval is set to 15 minutes by default. The hashAlgorithmType refers to the name of the encryption algorithm that is used to hash password values. (The default is SHA1.)

The child section lists all registered membership providers. Here’s the schema:

type="Samples.MyMembershipProvider"

connectionStringName="MyConnString"

enablePasswordRetrieval="false"

enablePasswordReset="true"

requiresQuestionAndAnswer="true"

passwordFormat="Hashed" />

...

You use the section to add custom membership providers. Each provider has its own set of attributes, as shown in the upcoming sections.

The Section


The section sets default values for many of the @Page directive attributes and declaratively configures the run-time environment for a Web page. Table 3-11 enumerates the supported attributes.

Table 3-11. Attributes to Configure ASP.NET Pages

Attribute

Description

asyncTimeout

Number of seconds to wait for an asynchronous handler to complete during asynchronous processing. The default is 45 seconds.

autoEventWireup

Indicates whether page events are automatically assigned to event handlers with a particular name (for example, Page_Load). It’s set to true by default.

buffer

Indicates whether or not response buffering is enabled. It’s set to true by default.

clientIDMode

Specifies the algorithm to use to generate the client ID for server controls. Feasible values are AutoID, Static, Predictable, and Inherit.

compilationMode

Indicates whether an ASP.NET page or control should be compiled at run time. Allowable values are Never, Auto, and Always—the default. Auto means that ASP.NET will not compile the page, if possible.

controlRenderingCompatibilityVersion

Indicates how controls are expected to render out their markup. The default value is 4.0, meaning that the markup is updated to the latest version. By setting it to 3.5 (no other values are supported), you fall back to the behavior of earlier versions of ASP.NET.

enableEventValidation

Specifies whether pages and controls validate postback and callback events. The default is true.

enableSessionState

Indicates whether session state is enabled. It’s set to true by default; it also accepts as values false and ReadOnly. The session state is disabled altogether if the attribute is set to false; it is accessible only for reading if set to ReadOnly.

enableViewState

Specifies whether view state is enabled. It’s set to true by default.

enableViewStateMac

Specifies whether the view state of a page should be checked for tampering on each page postback. It’s set to true by default.

maintainScrollPositionOnPostBack

If this is set to true, the page maintains the same scroll position after a postback.

masterPageFile

Specifies the master page for the pages in the scope of the configuration file.

maxPageStateFieldLength

Indicates the maximum length of the view-state field. A negative value indicates that no upper limit exists. If the size of the view state exceeds the maximum, the contents will be sent in chunks.

pageBaseType

Indicates the base code-behind class that .aspx pages inherit by default—unless a code-behind class is explicitly provided. The default class is System.Web.UI.Page. The new class name must include assembly information.

pageParserFilterType

Specifies the type of filter class that is used by the ASP.NET parser to determine whether an item is allowed in the page at parse time.

smartNavigation

Specifies whether smart navigation is enabled. This is set to false by default. It’s deprecated in favor of the maintainScrollPositionOnPostBack attribute.

styleSheetTheme

Name of the style-sheet theme used for the pages in the scope of the configuration file.

theme

Name of the theme used for the pages in the scope of the configuration file.

userControlBaseType

Indicates the code-behind

Return Main Page Previous Page Next Page

®Online Book Reader