Have you got a using System.Web; statement at the top of your class, and areference to the System.Web.dll file in your compiler command?