Sunday, July 8, 2012

MVC 3 Action Results

HttpNotFoundResult
public ActionResult Results()
{
return HttpNotFound();
}

HttpRedirectResult
public ActionResult Results()
{
return RedirectPermanent("http://google.com");
}

HttpStatusCodeResult
public AtionResult Results()
{
return HttpStatusCodeResult(415, "Media type not recognized");
}

No comments: