handling page navigation
styling pages and controls with CSS
If the list looks intimidating, dont worryall of this is far easier to understand
than it might first appear.
Web Forms
As you know, theres always new terminology to master when youre learning
new technologies. But with ASP.NET, even the simplest terms that are used to
describe the basics of web pages change to reflect the processes that occur within
them.
The term used to describe an ASP.NET web page is web form, and this is the
central object in ASP.NET development. Youve already met web formstheyre
the .aspx files youve worked with so far in this book. At first glance, web forms
look much like HTML pages, but in addition to static HTML content they also
contain ASP.NET presentational elements, and code that executes on the server
side to generate dynamic content and perform the desired server-side functionality.
Every web form includes a <form runat="server"> tag, which contains the
ASP.NET-specific elements that make up the page. Multiple forms arent suppor-
ted. The basic structure of a web form is shown here:
<html>
<head>
<script runat="server" language="language">
code here
</script>
</head>
<body>
<form runat="server">
user interface elements here
</form>
</body>
</html>
To access and manipulate a web form programatically, we use the
System.Web.UI.Page class. You might recognize this class from the code-behind
example we saw in Chapter 3. We must mention the class explicitly in the code-
behind file. In situations in which were not using code-behind files (i.e. we write
94
Chapter 4: Constructing ASP.NET Web Pages

Get Build Your Own ASP.NET 2.0 Web Site Using C# & VB, Second Edition 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.