This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A base class for an MVC controller with view support.
public ref class Controller abstract : Microsoft::AspNetCore::Mvc::ControllerBase, IDisposable, Microsoft::AspNetCore::Mvc::Filters::IActionFilter, Microsoft::AspNetCore::Mvc::Filters::IAsyncActionFilter
public abstract class Controller : Microsoft.AspNetCore.Mvc.ControllerBase, IDisposable, Microsoft.AspNetCore.Mvc.Filters.IActionFilter, Microsoft.AspNetCore.Mvc.Filters.IAsyncActionFilter
type Controller = class inherit ControllerBase interface IActionFilter interface IFilterMetadata interface IAsyncActionFilter interface IDisposable
Public MustInherit Class ControllerInherits ControllerBaseImplements IActionFilter, IAsyncActionFilter, IDisposable
Controller() |
ControllerContext | Gets or sets theControllerContext. (Inherited fromControllerBase) |
HttpContext | Gets theHttpContext for the executing action. (Inherited fromControllerBase) |
MetadataProvider | Gets or sets theIModelMetadataProvider. (Inherited fromControllerBase) |
ModelBinderFactory | Gets or sets theIModelBinderFactory. (Inherited fromControllerBase) |
ModelState | Gets theModelStateDictionary that contains the state of the model and of model-binding validation. (Inherited fromControllerBase) |
ObjectValidator | Gets or sets theIObjectModelValidator. (Inherited fromControllerBase) |
ProblemDetailsFactory | Gets or sets theProblemDetailsFactory. (Inherited fromControllerBase) |
Request | Gets theHttpRequest for the executing action. (Inherited fromControllerBase) |
Response | Gets theHttpResponse for the executing action. (Inherited fromControllerBase) |
RouteData | Gets theRouteData for the executing action. (Inherited fromControllerBase) |
TempData | Gets or setsITempDataDictionary used byViewResult. |
Url | Gets or sets theIUrlHelper. (Inherited fromControllerBase) |
User | Gets theClaimsPrincipal for user associated with the executing action. (Inherited fromControllerBase) |
ViewBag | Gets the dynamic view bag. |
ViewData | Gets or setsViewDataDictionary used byViewResult andViewBag. |
Accepted() | Creates anAcceptedResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
Accepted(Object) | Creates anAcceptedResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
Accepted(String, Object) | Creates anAcceptedResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
Accepted(String) | Creates anAcceptedResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
Accepted(Uri, Object) | Creates anAcceptedResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
Accepted(Uri) | Creates anAcceptedResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
AcceptedAtAction(String, Object, Object) | Creates anAcceptedAtActionResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
AcceptedAtAction(String, Object) | Creates anAcceptedAtActionResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
AcceptedAtAction(String, String, Object, Object) | Creates anAcceptedAtActionResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
AcceptedAtAction(String, String, Object) | Creates anAcceptedAtActionResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
AcceptedAtAction(String, String) | Creates anAcceptedAtActionResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
AcceptedAtAction(String) | Creates anAcceptedAtActionResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
AcceptedAtRoute(Object, Object) | Creates anAcceptedAtRouteResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
AcceptedAtRoute(Object) | Creates anAcceptedAtRouteResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
AcceptedAtRoute(String, Object, Object) | Creates anAcceptedAtRouteResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
AcceptedAtRoute(String, Object) | Creates anAcceptedAtRouteResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
AcceptedAtRoute(String) | Creates anAcceptedAtRouteResult object that produces aStatus202Accepted response. (Inherited fromControllerBase) |
BadRequest() | Creates aBadRequestResult that produces aStatus400BadRequest response. (Inherited fromControllerBase) |
BadRequest(ModelStateDictionary) | Creates aBadRequestObjectResult that produces aStatus400BadRequest response. (Inherited fromControllerBase) |
BadRequest(Object) | Creates aBadRequestObjectResult that produces aStatus400BadRequest response. (Inherited fromControllerBase) |
Challenge() | Creates aChallengeResult. (Inherited fromControllerBase) |
Challenge(AuthenticationProperties, String[]) | Creates aChallengeResult with the specified specified authentication schemes and |
Challenge(AuthenticationProperties, String[]) | Creates aChallengeResult with the specified authentication schemes and |
Challenge(AuthenticationProperties) | Creates aChallengeResult with the specified |
Challenge(AuthenticationProperties) | Creates aChallengeResult with the specified |
Challenge(String[]) | Creates aChallengeResult with the specified authentication schemes. (Inherited fromControllerBase) |
Conflict() | Creates aConflictResult that produces aStatus409Conflict response. (Inherited fromControllerBase) |
Conflict(ModelStateDictionary) | Creates aConflictObjectResult that produces aStatus409Conflict response. (Inherited fromControllerBase) |
Conflict(Object) | Creates aConflictObjectResult that produces aStatus409Conflict response. (Inherited fromControllerBase) |
Content(String, MediaTypeHeaderValue) | Creates aContentResult object by specifying a |
Content(String, String, Encoding) | Creates aContentResult object by specifying a |
Content(String, String) | Creates aContentResult object by specifying a |
Content(String) | Creates aContentResult object by specifying a |
Created() | Creates aCreatedResult object that produces aStatus201Created response. (Inherited fromControllerBase) |
Created(String, Object) | Creates aCreatedResult object that produces aStatus201Created response. (Inherited fromControllerBase) |
Created(Uri, Object) | Creates aCreatedResult object that produces aStatus201Created response. (Inherited fromControllerBase) |
CreatedAtAction(String, Object, Object) | Creates aCreatedAtActionResult object that produces aStatus201Created response. (Inherited fromControllerBase) |
CreatedAtAction(String, Object) | Creates aCreatedAtActionResult object that produces aStatus201Created response. (Inherited fromControllerBase) |
CreatedAtAction(String, String, Object, Object) | Creates aCreatedAtActionResult object that produces aStatus201Created response. (Inherited fromControllerBase) |
CreatedAtRoute(Object, Object) | Creates aCreatedAtRouteResult object that produces aStatus201Created response. (Inherited fromControllerBase) |
CreatedAtRoute(String, Object, Object) | Creates aCreatedAtRouteResult object that produces aStatus201Created response. (Inherited fromControllerBase) |
CreatedAtRoute(String, Object) | Creates aCreatedAtRouteResult object that produces aStatus201Created response. (Inherited fromControllerBase) |
Dispose() | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
Dispose(Boolean) | Releases all resources currently used by thisController instance. |
File(Byte[], String, Boolean) | Returns a file with the specified |
File(Byte[], String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) | Returns a file with the specified |
File(Byte[], String, Nullable<DateTimeOffset>, EntityTagHeaderValue) | Returns a file with the specified |
File(Byte[], String, String, Boolean) | Returns a file with the specified |
File(Byte[], String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) | Returns a file with the specified |
File(Byte[], String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) | Returns a file with the specified |
File(Byte[], String, String) | Returns a file with the specified |
File(Byte[], String) | Returns a file with the specified |
File(Stream, String, Boolean) | Returns a file in the specified |
File(Stream, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) | Returns a file in the specified |
File(Stream, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) | Returns a file in the specified |
File(Stream, String, String, Boolean) | Returns a file in the specified |
File(Stream, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) | Returns a file in the specified |
File(Stream, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) | Returns a file in the specified |
File(Stream, String, String) | Returns a file in the specified |
File(Stream, String) | Returns a file in the specified |
File(String, String, Boolean) | Returns the file specified by |
File(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) | Returns the file specified by |
File(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) | Returns the file specified by |
File(String, String, String, Boolean) | Returns the file specified by |
File(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) | Returns the file specified by |
File(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) | Returns the file specified by |
File(String, String, String) | Returns the file specified by |
File(String, String) | Returns the file specified by |
Forbid() | Creates aForbidResult (Status403Forbidden by default). (Inherited fromControllerBase) |
Forbid(AuthenticationProperties, String[]) | Creates aForbidResult (Status403Forbidden by default) with thespecified authentication schemes and |
Forbid(AuthenticationProperties, String[]) | Creates aForbidResult with the specified specified authentication schemes and |
Forbid(AuthenticationProperties) | Creates aForbidResult (Status403Forbidden by default) with thespecified |
Forbid(AuthenticationProperties) | Creates aForbidResult with the specified |
Forbid(String[]) | Creates aForbidResult (Status403Forbidden by default) with thespecified authentication schemes. (Inherited fromControllerBase) |
Json(Object, JsonSerializerSettings) | Creates aJsonResult object that serializes the specified |
Json(Object, Object) | Creates aJsonResult object that serializes the specified |
Json(Object) | Creates aJsonResult object that serializes the specified |
LocalRedirect(String) | Creates aLocalRedirectResult object that redirects(Status302Found) to the specified local |
LocalRedirectPermanent(String) | Creates aLocalRedirectResult object withPermanent set totrue (Status301MovedPermanently) using the specified |
LocalRedirectPermanentPreserveMethod(String) | Creates aLocalRedirectResult object withPermanent set totrue andPreserveMethod set to true(Status308PermanentRedirect) using the specified |
LocalRedirectPreserveMethod(String) | Creates aLocalRedirectResult object withPermanent set tofalse andPreserveMethod set to true(Status307TemporaryRedirect) using the specified |
NoContent() | Creates aNoContentResult object that produces an emptyStatus204NoContent response. (Inherited fromControllerBase) |
NotFound() | Creates aNotFoundResult that produces aStatus404NotFound response. (Inherited fromControllerBase) |
NotFound(Object) | Creates aNotFoundObjectResult that produces aStatus404NotFound response. (Inherited fromControllerBase) |
Ok() | Creates anOkResult object that produces an emptyStatus200OK response. (Inherited fromControllerBase) |
Ok(Object) | Creates anOkObjectResult object that produces aStatus200OK response. (Inherited fromControllerBase) |
OnActionExecuted(ActionExecutedContext) | Called after the action method is invoked. |
OnActionExecuting(ActionExecutingContext) | Called before the action method is invoked. |
OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate) | Called before the action method is invoked. |
PartialView() | Creates aPartialViewResult object that renders a partial view to the response. |
PartialView(Object) | Creates aPartialViewResult object by specifying a |
PartialView(String, Object) | Creates aPartialViewResult object by specifying a |
PartialView(String) | Creates aPartialViewResult object by specifying a |
PhysicalFile(String, String, Boolean) | Returns the file specified by |
PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) | Returns the file specified by |
PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) | Returns the file specified by |
PhysicalFile(String, String, String, Boolean) | Returns the file specified by |
PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) | Returns the file specified by |
PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) | Returns the file specified by |
PhysicalFile(String, String, String) | Returns the file specified by |
PhysicalFile(String, String) | Returns the file specified by |
Problem(String, String, Nullable<Int32>, String, String, IDictionary<String,Object>) | Creates anObjectResult that produces aProblemDetails response. (Inherited fromControllerBase) |
Problem(String, String, Nullable<Int32>, String, String) | Creates anObjectResult that produces aProblemDetails response. (Inherited fromControllerBase) |
Redirect(String) | Creates aRedirectResult object that redirects (Status302Found)to the specified |
RedirectPermanent(String) | Creates aRedirectResult object withPermanent set to true(Status301MovedPermanently) using the specified |
RedirectPermanentPreserveMethod(String) | Creates aRedirectResult object withPermanent set to trueandPreserveMethod set to true (Status308PermanentRedirect)using the specified |
RedirectPreserveMethod(String) | Creates aRedirectResult object withPermanent set to falseandPreserveMethod set to true (Status307TemporaryRedirect)using the specified |
RedirectToAction() | Redirects (Status302Found) to an action with the same name as current one.The 'controller' and 'action' names are retrieved from the ambient values of the current request. (Inherited fromControllerBase) |
RedirectToAction(String, Object) | Redirects (Status302Found) to the specified action using the |
RedirectToAction(String, String, Object, String) | Redirects (Status302Found) to the specified action using the specified |
RedirectToAction(String, String, Object) | Redirects (Status302Found) to the specified action using the specified |
RedirectToAction(String, String, String) | Redirects (Status302Found) to the specified action using the specified |
RedirectToAction(String, String) | Redirects (Status302Found) to the specified action using the |
RedirectToAction(String) | Redirects (Status302Found) to the specified action using the |
RedirectToActionPermanent(String, Object) | Redirects (Status301MovedPermanently) to the specified action withPermanent set to true using the specified |
RedirectToActionPermanent(String, String, Object, String) | Redirects (Status301MovedPermanently) to the specified action withPermanent set to true using the specified |
RedirectToActionPermanent(String, String, Object) | Redirects (Status301MovedPermanently) to the specified action withPermanent set to true using the specified |
RedirectToActionPermanent(String, String, String) | Redirects (Status301MovedPermanently) to the specified action withPermanent set to true using the specified |
RedirectToActionPermanent(String, String) | Redirects (Status301MovedPermanently) to the specified action withPermanent set to true using the specified |
RedirectToActionPermanent(String) | Redirects (Status301MovedPermanently) to the specified action withPermanent set to true using the specified |
RedirectToActionPermanentPreserveMethod(String, String, Object, String) | Redirects (Status308PermanentRedirect) to the specified action withPermanent set to true andPreserveMethodset to true, using the specified |
RedirectToActionPreserveMethod(String, String, Object, String) | Redirects (Status307TemporaryRedirect) to the specified action withPermanent set to false andPreserveMethodset to true, using the specified |
RedirectToPage(String, Object) | Redirects (Status302Found) to the specified |
RedirectToPage(String, String, Object, String) | Redirects (Status302Found) to the specified |
RedirectToPage(String, String, Object) | Redirects (Status302Found) to the specified |
RedirectToPage(String, String, String) | Redirects (Status302Found) to the specified |
RedirectToPage(String, String) | Redirects (Status302Found) to the specified |
RedirectToPage(String) | Redirects (Status302Found) to the specified |
RedirectToPagePermanent(String, Object) | Redirects (Status301MovedPermanently) to the specified |
RedirectToPagePermanent(String, String, Object, String) | Redirects (Status301MovedPermanently) to the specified |
RedirectToPagePermanent(String, String, String) | Redirects (Status301MovedPermanently) to the specified |
RedirectToPagePermanent(String, String) | Redirects (Status301MovedPermanently) to the specified |
RedirectToPagePermanent(String) | Redirects (Status301MovedPermanently) to the specified |
RedirectToPagePermanentPreserveMethod(String, String, Object, String) | Redirects (Status308PermanentRedirect) to the specified route withPermanent set to true andPreserveMethodset to true, using the specified |
RedirectToPagePreserveMethod(String, String, Object, String) | Redirects (Status307TemporaryRedirect) to the specified page withPermanent set to false andPreserveMethodset to true, using the specified |
RedirectToRoute(Object) | Redirects (Status302Found) to the specified route using the specified |
RedirectToRoute(String, Object, String) | Redirects (Status302Found) to the specified route using the specified |
RedirectToRoute(String, Object) | Redirects (Status302Found) to the specified route using the specified |
RedirectToRoute(String, String) | Redirects (Status302Found) to the specified route using the specified |
RedirectToRoute(String) | Redirects (Status302Found) to the specified route using the specified |
RedirectToRoutePermanent(Object) | Redirects (Status301MovedPermanently) to the specified route withPermanent set to true using the specified |
RedirectToRoutePermanent(String, Object, String) | Redirects (Status301MovedPermanently) to the specified route withPermanent set to true using the specified |
RedirectToRoutePermanent(String, Object) | Redirects (Status301MovedPermanently) to the specified route withPermanent set to true using the specified |
RedirectToRoutePermanent(String, String) | Redirects (Status301MovedPermanently) to the specified route withPermanent set to true using the specified |
RedirectToRoutePermanent(String) | Redirects (Status301MovedPermanently) to the specified route withPermanent set to true using the specified |
RedirectToRoutePermanentPreserveMethod(String, Object, String) | Redirects (Status308PermanentRedirect) to the specified route withPermanent set to true andPreserveMethodset to true, using the specified |
RedirectToRoutePreserveMethod(String, Object, String) | Redirects (Status307TemporaryRedirect) to the specified route withPermanent set to false andPreserveMethodset to true, using the specified |
SignIn(ClaimsPrincipal, AuthenticationProperties, String) | Creates aSignInResult with the specified specified authentication scheme and |
SignIn(ClaimsPrincipal, AuthenticationProperties, String) | Creates aSignInResult with the specified authentication scheme and |
SignIn(ClaimsPrincipal, AuthenticationProperties) | Creates aSignInResult with |
SignIn(ClaimsPrincipal, String) | Creates aSignInResult with the specified authentication scheme. (Inherited fromControllerBase) |
SignIn(ClaimsPrincipal) | Creates aSignInResult. (Inherited fromControllerBase) |
SignOut() | Creates aSignOutResult. (Inherited fromControllerBase) |
SignOut(AuthenticationProperties, String[]) | Creates aSignOutResult with the specified authentication schemes and |
SignOut(AuthenticationProperties, String[]) | Creates aSignOutResult with the specified specified authentication schemes and |
SignOut(AuthenticationProperties) | Creates aSignOutResult with |
SignOut(String[]) | Creates aSignOutResult with the specified authentication schemes. (Inherited fromControllerBase) |
StatusCode(Int32, Object) | Creates anObjectResult object by specifying a |
StatusCode(Int32) | Creates aStatusCodeResult object by specifying a |
TryUpdateModelAsync(Object, Type, String, IValueProvider, Func<ModelMetadata,Boolean>) | Updates the specified |
TryUpdateModelAsync(Object, Type, String) | Updates the specified |
TryUpdateModelAsync<TModel>(TModel, String, Expression<Func<TModel,Object>>[]) | Updates the specified |
TryUpdateModelAsync<TModel>(TModel, String, Func<ModelMetadata,Boolean>) | Updates the specified |
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Expression<Func<TModel,Object>>[]) | Updates the specified |
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Func<ModelMetadata,Boolean>) | Updates the specified |
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider) | Updates the specified |
TryUpdateModelAsync<TModel>(TModel, String) | Updates the specified |
TryUpdateModelAsync<TModel>(TModel) | Updates the specified |
TryValidateModel(Object, String) | Validates the specified |
TryValidateModel(Object) | Validates the specified |
Unauthorized() | Creates anUnauthorizedResult that produces aStatus401Unauthorized response. (Inherited fromControllerBase) |
Unauthorized(Object) | Creates anUnauthorizedObjectResult that produces aStatus401Unauthorized response. (Inherited fromControllerBase) |
UnprocessableEntity() | Creates anUnprocessableEntityResult that produces aStatus422UnprocessableEntity response. (Inherited fromControllerBase) |
UnprocessableEntity(ModelStateDictionary) | Creates anUnprocessableEntityObjectResult that produces aStatus422UnprocessableEntity response. (Inherited fromControllerBase) |
UnprocessableEntity(Object) | Creates anUnprocessableEntityObjectResult that produces aStatus422UnprocessableEntity response. (Inherited fromControllerBase) |
ValidationProblem() | Creates anActionResult that produces aStatus400BadRequest responsewith validation errors fromModelState. (Inherited fromControllerBase) |
ValidationProblem(ModelStateDictionary) | Creates anActionResult that produces aStatus400BadRequest responsewith validation errors from |
ValidationProblem(String, String, Nullable<Int32>, String, String, ModelStateDictionary, IDictionary<String,Object>) | Creates anActionResult that produces aStatus400BadRequest responsewith aValidationProblemDetails value. (Inherited fromControllerBase) |
ValidationProblem(String, String, Nullable<Int32>, String, String, ModelStateDictionary) | Creates anActionResult that produces aStatus400BadRequest responsewith aValidationProblemDetails value. (Inherited fromControllerBase) |
ValidationProblem(ValidationProblemDetails) | Creates aBadRequestObjectResult that produces aStatus400BadRequest response. (Inherited fromControllerBase) |
View() | Creates aViewResult object that renders a view to the response. |
View(Object) | Creates aViewResult object by specifying a |
View(String, Object) | Creates aViewResult object by specifying a |
View(String) | Creates aViewResult object by specifying a |
ViewComponent(String, Object) | Creates aViewComponentResult by specifying the name of a view component to render. |
ViewComponent(String) | Creates aViewComponentResult by specifying the name of a view component to render. |
ViewComponent(Type, Object) | Creates aViewComponentResult by specifying theType of a view component torender. |
ViewComponent(Type) | Creates aViewComponentResult by specifying theType of a view component torender. |
Was this page helpful?
Was this page helpful?