Full domain redirects like the one you mention are best done at the IIS level, but if you aren't able to configure IIS you could use Response.RedirectPermanent, which is new in ASP.NET 4.0. This will redirect with a 301 (permanent) status code instead of the 302 (object moved) status code used by a standard Response.Redirect.
Put this code inside Global.asax file:
protected void Application_BeginRequest(object sender, EventArgs e)
{
if (!(Request.Url.AbsoluteUri.ToLower().Contains("www")))
{
Response.RedirectPermanent(Request.Url.AbsoluteUri.Replace("http://", "http://www."));
}
}