ViewComponent ViewComponent ViewComponent Class

Definition

A base class for view components.

[Microsoft.AspNetCore.Mvc.ViewComponent]
public abstract class ViewComponent
type ViewComponent = class
Public MustInherit Class ViewComponent
Inheritance
ViewComponentViewComponentViewComponent
Attributes

Constructors

ViewComponent() ViewComponent() ViewComponent()

Properties

HttpContext HttpContext HttpContext

Gets the HttpContext.

ModelState ModelState ModelState

Gets the ModelStateDictionary.

Request Request Request

Gets the HttpRequest.

RouteData RouteData RouteData

Gets the RouteData for the current request.

TempData TempData TempData

Gets the ITempDataDictionary.

Url Url Url

Gets or sets the IUrlHelper.

User User User

Gets the IPrincipal for the current user.

UserClaimsPrincipal UserClaimsPrincipal UserClaimsPrincipal

Gets the ClaimsPrincipal for the current user.

ViewBag ViewBag ViewBag

Gets the view bag.

ViewComponentContext ViewComponentContext ViewComponentContext
ViewContext ViewContext ViewContext

Gets the ViewContext.

ViewData ViewData ViewData

Gets the ViewDataDictionary.

ViewEngine ViewEngine ViewEngine

Gets or sets the ICompositeViewEngine.

Methods

Content(String) Content(String) Content(String)

Returns a result which will render HTML encoded text.

View() View() View()

Returns a result which will render the partial view with name "Default".

View(String) View(String) View(String)

Returns a result which will render the partial view with name viewName.

View<TModel>(TModel) View<TModel>(TModel) View<TModel>(TModel)

Returns a result which will render the partial view with name "Default".

View<TModel>(String, TModel) View<TModel>(String, TModel) View<TModel>(String, TModel)

Returns a result which will render the partial view with name viewName.

Applies to