Create ASP.NET Page Hosted In SharePoint

This is an example of how to create an ASP.NET page with code-behind, hosted in SharePoint.

Reference
Microsoft.Sharepoint (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\Microsoft.SharePoint.dll)

The ASPX
<%@ Page Language="c#" Inherits="My.Namespace.Code.Pages.MyPage, My.Assembly.Name, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XXX" MasterPageFile="~/_layouts/application.master" Culture="auto" UICulture="auto" %>  Some Title Goes Here   Items to be hosted in the left menu bar go here   Main content goes here...  

The Code-Behind
namespace My.Namespace.Code.Pages {    public partial class MyPage : LayoutsPageBase {        protected void Page_Load(object sender, EventArgs e)         { lblMessage.Text = "This is a test"; }    } }