ASP.NET 2.0 Web Parts
using System;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
namespace LitwareWebParts { 
  public class HelloWorldWebPart : WebPart {
    protected override void OnPreRender(EventArgs e)  {
      this.Title = "Litware Project Revenue";
    }
    protected override void RenderContents(HtmlTextWriter writer) {
      writer.Write("Hello, world");
    }
  }
}
Instructor Notes
This code sample shows the Hello World Web Part written for the ASP.NET 2.0 Web Part environment. All ASP-style Web Parts must derive from the ASP.NET WebPart base class. A simple Hello World Web Part doesn't need to do anything other than override the RednerContents method and write a simple text string as output back to the browser.