Asp. NET Web page directive (page Directive) is the label declaration at the beginning of the page:
<% page language= "C #"%>
The purpose of the directive is to specify the settings that are used by the Web page and the user control compiler to process the ASP. NET Web Form Web page (. aspx file) and user control (. ascx) files. The following table is all instructions for asp.net4.0.
asp.net4.0 Directive
Instructions |
Description |
@Master |
Identify a Web page as the primary page (the master page) and define properties for the ASP. NET Web page Profiler and compiler that can only be included in the. Master file |
@MasterType |
Defines the class or virtual path used to enter the master property of a Web page |
@Register |
Associating aliases (alias) with namespaces and classes allows user controls and custom server controls to be rendered when they are contained in a required web page or user space |
@OutputCache |
Declaratively control the output cache principle for a Web page or user control |
@Import |
Explicitly import namespaces to Web pages or user controls |
@Control |
Define specific control properties that can be used by the ASP. NET Web page Profiler and the editor and can only join. ascx files (user controls) |
@Reference |
To link a Web page, user control, or COM control to the current Web page or user control declaratively |
@WebHandler |
Defining properties and compilation options for an HTTP handler (. ashx) file |
@PreviousPageType |
Establish a strongly typed reference to the target source page of a cross-page send |
@Assembly |
To link a component to the current page or user control declaratively |
@Implements |
Declaratively representing a Web page or user control implements the specified. NET Framework Interface |
@Page |
Define a specific page property that can be used by the ASP. NET Web page Profiler and the editor and can only join. ascx files |
These directives have specific companion applications, such as the main page, which uses the @master directive, which uses the @previouspagetype directive, which itself contains a lot of attributes, and if you want to learn more, check the MSDN Library online Help file. Fortunately, in most cases, we do not need to manually add these instructions, because Visual Studio joins automatically, but if you encounter situations where you need to manually join yourself, simply query their usage in the online Help file.
Asp. NET Directive Syntax:
Http://msdn.microsoft.com/zh-tw/library/xz702w3e.aspx