Web Tutorials

Interview Q & A

Code Examples

Utility Tools

ASP.NET Page Directive

ASP.NET page defines is page-specific (.aspx file) attributes used by the ASP.NET page parser and compiler.

Syntax

Page Directive Attributes

AttributesDescription
AutoEventWireupSpecifies the page event should autowired or not.
ClassNameSpecifies the class name that will be dynamically compiled when the page is requested.
CodeFileSpecifies the code-behind class for the current page.
CodeBehindSpecifies the path to the code-behind class for the current page.
CodeFileBaseClassSpecifies the type name of a base class for a page and its associated code-behind class
CompilerOptionsSpecifies compilation options for current page.
DescriptionSpecifies a text description of the master page.
DebugSpecifies page should be compiled with debug symbols.
LanguageSpecifies language being used when compiling inline code blocks.
InheritsSpecifies the base class for the page to inherit.
SrcSpecifies the source file that contains the implementation of the base class specified with Inherits.
MasterPageFileSpecifies the master page for the current page.
EnableSessionStateSpecifies the page should treat session data (true, false, readonly).
EnableViewStateSpecifies whether the page view state is maintained across page requests.
EnableThemingSpecifies the page will support themes for embedded controls.
ErrorPageSpecifies the error page URL to unhandled page exceptions.
ValidateRequestSpecifies whether the page request validation should occur.
CodePageSpecifies the code page value for the response.
ContentTypeSpecifies the HTTP content type of the page response.
TitleSpecifies the title of the page.
ResponseEncodingSpecifies the character encoding of the page.
BufferSpecifies HTTP response buffer of the page.

ASP.NET Page Directive Example C#

ASP.NET Page Directive Example VB

RequiredFieldValidator

RegularExpressionValidator

RangValidator

CompareValidator

CustomValidator

ValidationSummary