Changes to Page Directives

To cater to some of the new features in ASP.NET 2.0, there are new page-level directives and attributes that apply to a variety of files. These new directives are listed below:

  • Image , which applies to dynamic image files of type .ASIX (see Chapter 12)

  • Master , used to identify a master page

  • PreviousPage , used to identify the previous page in a cross-page posting scenario

Detailed explanation of master pages appears in Chapter 5, although the attributes are outlined here.

The Page Directive

The Page directive has several new attributes, as shown in Table 9.6.

The Master Directive

The Master directive can have the following attributes:

  • AutoEventWireup

  • CompilerOptions

  • CodeBehind

  • Description

  • EnablePersonalization

  • Inherits

  • LinePragmas

  • Src

  • TargetSchema

  • ClassName

  • CompileWith

  • Debug

  • EnableViewState

  • Explicit

  • Language

  • Master

  • Strict

All of these are similar to those for the Page directive, having either the functionality described in Table 9.6 for new attributes or the same functionality as in version 1.x of ASP.NET.

Table 9.6. New Attributes for the Page Directive

Attribute

Description

CompileWith

A String indicating the path (relative or absolute) to the code-separation file. A Namespace is required for the code-beside file, and the ClassName attribute must also be specified.

EnablePersonalization

A Boolean indicating whether Personalization is enabled for the page.

LinePragmas

A Boolean indicating whether line pragmas are added to the compiled assembly.

Master

A String indicating the path (relative or absolute) to the master page.

PersonalizationProvider

The name of a Personalization provider, as detailed in the configuration file.

TargetSchema

This attribute is currently ignored and is intended for future releases.

Theme

The name of a theme.

The Control Directive

The Control directive has the following new attributes:

  • CompileWith

  • EnablePersonalization

  • LinePragmas

  • Master

  • TargetSchema

The attributes have the functionality described in Table 9.6.

The PreviousPage Directive

The PreviousPage directive is covered in more detail in the Cross-Page Posting section earlier in this chapter. This directive has two attributes, as shown in Table 9.7. Only one of these can be used at a timethat is, you cannot specify both the TypeName and the VirtualPath .

Table 9.7. Attributes for the PreviousPage Directive

Attribute

Description

TypeName

The strong type of the previous page. If this is not set, it defaults to type Page .

VirtualPath

The relative path of the ASP.NET page from which the request originated.

The Image Directive

The Image directive, used in .ASIX pages as part of the image generation service, has two attributes, as shown in Table 9.8.

Table 9.8. Attributes for the Image Directive

Attribute

Description

Language

The language used within code in the page.

Class

The class name of the new image class.



A First Look at ASP. NET v. 2.0 2003
A First Look at ASP. NET v. 2.0 2003
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 90

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net