You could return a hardcoded content instead of a view:
public ActionResult Contact()
{
return Content("Hello");
}
You could return JSON:
public ActionResult Contact()
{
return Json(new { Foo = "bar" }, JsonRequestBehavior.AllowGet);
}
You could return javascript:
public ActionResult Contact()
{
return JavaScript("alert('Hello World');");
}
You could directly stream a file:
public ActionResult Contact()
{
return File(@"c:\work\foo.pdf", "application/pdf", "foo.pdf");
}
You could return a 404:
public ActionResult Contact()
{
return HttpNotFound();
}
You could return 401:
public ActionResult Contact()
{
return new HttpUnauthorizedResult();
}
And if the built-in action results doesn't suit your needs you could always write a custom one. For example one that returns XML:
public class XmlResult : ActionResult
{
private readonly object _data;
public XmlResult(object data)
{
if (_data == null)
{
throw new ArgumentNullException("data");
}
_data = data;
}
public override void ExecuteResult(ControllerContext context)
{
var response = context.HttpContext.Response;
response.ContentType = "text/xml";
var serializer = new XmlSerializer(_data.GetType());
serializer.Serialize(response.OutputStream, _data);
}
}
and then:
public ActionResult Contact()
{
return new XmlResult(new { Foo = "Bar" });
}
So as you can see there are plenty of things you could do. The question is: what do you want to do?