Using Response.write is a handy and straightforward way of doing debugging but they aren't cool for you might forgotten to comment them out and accidentally leak the debugging info to production environment.

Response.Write("Hello World");

The top reason i don't like it: it mess with the layout and can be hard to read.

Using Trace

A better way is to use Trace. It is a handy built-in function and works just out of the box. Check out Trace in MSDN: http://msdn.microsoft.com/en-us/library/y13fw6we(VS.71).aspx

To use it:

First, enable it in web.config (the one which is same level as your Global.asax) for application wide configuration.

<system.web>
  <trace enabled="true" requestLimit="10" pageOutput="true" traceMode="SortByTime" />
</system.web>

Next, inside your controller, using HttpContext, call Trace:

public ActionResult Index()
{
    HttpContext.Trace.Warn("Hello World!");
    return View(_entities.ContactSet.ToList());
}

 

The result page.

If you don't like to see the debugging information append to your page, you just need to turn off the pageOutput parameter in web.config and then, browse to: http://localhost/Trace.axd

Your custom debugging information can be found there as well.