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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.