O'Reilly logo

Programming ASP.NET, 3rd Edition by Dan Hurwitz, Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Page

An ASP.NET page consists of, at the minimum, a single file with an extension of .aspx though, typically, other files will be associated with the page, as we will describe. In the parlance of VS2005, this .aspx file is called the content file because it contains primarily the visual content of the page, i.e., HTML, text, and ASP.NET server controls.

Any content in the content file that is not part of a server control or server-side code is treated as a normal HTML file. It is passed from the server to the browser exactly as is, so the browser can deal with as it would any other HTML.

The .aspx file can contain script blocks. These are written in a scripting (non-compiled) language, such as JavaScript or VBScript, which will execute client side, meaning on the browser. It may also contain server-side code blocks, written in any .NET supported language, such as C# or VB2005, though these code blocks are more commonly contained in a separate code-behind file, as will be described in the next section.

When a browser requests the .aspx file from a web server, the server processes the page. If it is the first time that the page has been requested since the web application started, the ASP.NET runtime will compile from the page a Page class that derives from the base System.Web.UI.Page class. The compiled class contains all the control declarations and code that make up the page, including properties , event handlers, and other methods.

Tip

Everyone knows what an application is, more ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required