ASP.NET Directives The Page Directive

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

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:

AttributesDescription
AutoEventWireupThe Boolean value that enables or disables page events that are being automatically bound to methods; for example, Page_Load.
BufferThe Boolean value that enables or disables HTTP response buffering.
ClassNameThe class name for the page.
ClientTargetThe browser for which the server controls should render content.
CodeFileThe name of the code behind file.
DebugThe Boolean value that enables or disables compilation with debug symbols.
DescriptionThe text description of the page, ignored by the parser.
EnableSessionStateIt enables, disables, or makes session state read-only.
EnableViewStateThe Boolean value that enables or disables view state across page requests.
ErrorPageURL for redirection if an unhandled page exception occurs.
InheritsThe name of the code behind or other class.
LanguageThe programming language for code.
SrcThe file name of the code behind class.
TraceIt enables or disables tracing.
TraceModeIt indicates how trace messages are displayed, and sorted by time or category.
TransactionIt indicates if transactions are supported.
ValidateRequestThe Boolean value that indicates whether all input data is validated against a hardcoded list of values.


Got any ASP.NET Question?