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 pagePreviousPage, 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:AutoEventWireupCompilerOptionsCodeBehindDescriptionEnablePersonalizationInheritsLinePragmasSrcTargetSchemaClassNameCompileWithDebugEnableViewStateExplicitLanguageMasterStrict
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.
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:CompileWithEnablePersonalizationLinePragmasMasterTargetSchema
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.
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.
Attribute | Description |
---|---|
Language | The language used within code in the page. |
Class | The class name of the new image class. |