ASP.NET Directives
ASP.NET @ Webpage Directives
ASP.NET @ Application Directives
ASP.NET Inline Directives
Source/Reference
ASP.NET Directives
Similar to ASP, ASP.NET use directive as extra features for setting the process configuration of the ASP.NET engine
execution. But unlike ASP, ASP.NET @ webpage directives are used by the page and user-control compilers when the compilers process ASP.NET web forms page files with file extension .aspx and user control files with file extension .ascx. ASP.NET application @ directives are used by ASP.NET parser when processing ASP.NET global application files with file extension .asax. Besides there are also some general ASP.NET inline directives which are used in ASP.NET scripting.
ASP.NET @ Webpage Directives
The supported ASP.NET @ directives for web form and user control are
@ Assembly: Links an assembly to the current page or user control declaratively.
@ Control: Defines control-specific attributes used by the ASP.NET page parser and compiler and can be included only in .ascx files (user controls).
@ Implements: Indicates that a page or user control implements a specified .NET Framework interface declaratively.
@ Import: Imports a namespace into a page or user control explicitly.
@ Master: Identifies a page as a master page and defines attributes used by the ASP.NET page parser and compiler and can be included only in .master files.
@ MasterType: Defines the class or virtual path used to type the Master property of a page.
@ OutputCache: Controls the output caching policies of a page or user control declaratively.
@ Page: Defines page-specific attributes used by the ASP.NET page parser and compiler and can be included only in .aspx files.
@ PreviousPageType: Creates a strongly typed reference to the source page from the target of a cross-page posting.
@ Reference: Links a page, user control, or COM control to the current page or user control declaratively.
@ Register: Associates aliases with namespaces and classes, which allow user controls and custom server controls to be rendered when included in a requested page or user control.
ASP.NET @ Application Directives
Application directives specify optional application-specific settings used by the ASP.NET parser when processing ASP.NET global application (.asax) files. Application directives are located at the top of the Global.asax file.
@ Application: Defines application-specific attributes used by the ASP.NET application compiler.
@ Import: Explicitly imports a namespace into an application.
@ Assembly: Links an assembly to the application at parse time.
ASP.NET Inline Directives
The supported ASP.NET inline directives for ASP.NET scripting are