Friday, August 6, 2010

The Anatomy of an ASPX Page

The Anatomy of an ASPX Page


A page in ASP.NET contains user interface layout information, code that executes on the server, and directives to both connect the layout with the code and to tell ASP.NET how the page should be processed. The standard ASP.NET page has an .aspx extension. The typical .aspx page includes three sections: page directives, code, and page layout.


Page directives This section is used to set up the environment, specifying how the page should be processed. For example, this is where you can indicate an associated code file, development language, transaction, and more.

Code This section contains code to handle events that execute on the server based on the ASP.NET page processing model. By default, Visual Studio creates a separate file that contains your code. This is called a code-behind file and is attached to the .aspx page.

Page layout The page layout is written using HTML. This includes the HTML body, markup, and style information. The HTML body may contain HTML tags, Visual Studio controls, user controls, and simple text.

No comments: