The Page directive defines the attributes specific to the page file for the page parser and the compiler.
The basic syntax of Page directive is:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Trace="true" %>
The attributes of the Page directive are:
Attributes | Description |
---|---|
AutoEventWireup | The Boolean value that enables or disables page events that are being automatically bound to methods; for example, Page_Load. |
Buffer | The Boolean value that enables or disables HTTP response buffering. |
ClassName | The class name for the page. |
ClientTarget | The browser for which the server controls should render content. |
CodeFile | The name of the code behind file. |
Debug | The Boolean value that enables or disables compilation with debug symbols. |
Description | The text description of the page, ignored by the parser. |
EnableSessionState | It enables, disables, or makes session state read-only. |
EnableViewState | The Boolean value that enables or disables view state across page requests. |
ErrorPage | URL for redirection if an unhandled page exception occurs. |
Inherits | The name of the code behind or other class. |
Language | The programming language for code. |
Src | The file name of the code behind class. |
Trace | It enables or disables tracing. |
TraceMode | It indicates how trace messages are displayed, and sorted by time or category. |
Transaction | It indicates if transactions are supported. |
ValidateRequest | The Boolean value that indicates whether all input data is validated against a hardcoded list of values. |