SaaS CMS has officially launched! Learn more now.

Class PartialContentController<TContentData>

Provides the base implementation for partial content controller

Inheritance
System.Object
PartialContentController<TContentData>
Implements
IRenderTemplate<TContentData>
Namespace: EPiServer.Web.Mvc
Assembly: EPiServer.Cms.AspNetCore.Mvc.dll
Version: 12.0.3
Syntax
public abstract class PartialContentController<TContentData> : PartialContentComponent<TContentData>, IRenderTemplate<TContentData>, IRenderTemplate where TContentData : IContentData
Type Parameters
Name Description
TContentData

The type of the content data.

Constructors

PartialContentController()

Declaration
protected PartialContentController()

Methods

Index(TContentData)

Base method for default action

Declaration
public virtual ActionResult Index(TContentData currentContent)
Parameters
Type Name Description
TContentData currentContent

The current content instance.

Returns
Type Description
Microsoft.AspNetCore.Mvc.ActionResult

Content from the view

InvokeComponent(TContentData)

Gets view from Index method and return it as string

Declaration
protected override IViewComponentResult InvokeComponent(TContentData currentContent)
Parameters
Type Name Description
TContentData currentContent

The current content instance.

Returns
Type Description
Microsoft.AspNetCore.Mvc.IViewComponentResult

HtmlContentViewComponentResult

Overrides
EPiServer.Web.Mvc.PartialContentComponent<TContentData>.InvokeComponent(TContentData)

View(TContentData)

Helper method to mimic the View method for controllers

Declaration
public ActionResult View(TContentData currentContent)
Parameters
Type Name Description
TContentData currentContent

The content to render through a view

Returns
Type Description
Microsoft.AspNetCore.Mvc.ActionResult

The view result

View(String, TContentData)

Helper method to mimic the View method for controllers

Declaration
public ActionResult View(string viewName, TContentData currentContent)
Parameters
Type Name Description
System.String viewName

The name of the view to use

TContentData currentContent

The content to render through a view

Returns
Type Description
Microsoft.AspNetCore.Mvc.ActionResult

The view result

Implements

Extension Methods