Provides methods that respond to HTTP requests to an ASP.NET MVC Web site.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
A controller class name must end with "Controller". For example, a Product controller could be named ProductController but not Product or ProductCtrl.
Controller action methods respond to requests that are sent to the controller. Controller action methods have the following restrictions:
Action methods must be public.
Action methods cannot be static.
Action methods cannot have unbounded generic type parameters. An unbounded generic type parameter has an empty parameter list. An unbounded generic type is also known as an open generic type. For information about unbounded generic type parameters, see the section "Unbounded Type Parameters" in Constraints on Type Parameters (C# Programming Guide).
The following table lists the types that a controller action method can return and the scenarios for which the types are returned.
Control action return
void or null
Object (excluding ActionResult)
The result is passed to a CreateActionResult, which creates a new ContentResult object. The Content property of the ContentResult object is set to the invariant string representation of the returned object.