The Page Syntax

When programming Web Forms, it is important to know the page syntax of an ASP.NET file. There are ten distinct syntax elements in ASP.NET. Each is explained below.

Page Directives

Page directives specify optional settings used by the page compiler when processing ASP.NET files. They can be located anywhere within an .aspx file. Each directive can contain one or more attribute or value pairs specific to that directive.

The general syntax of a page directive is as follows:

<%@ directive attribute=value [attribute=value … ]%> 

The Web Forms page framework supports the following directives:

  • @ Page

  • @ Control

  • @ Import

  • @ Register

  • @ Assembly

  • @ OutputCache

The @ Page Directive

The @ Page directive defines page-specific attributes used by ...

Get Inside ASP.NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.