Class PartialContentController<TContentData>
Provides the base implementation for partial content controller
Inheritance
System.Object
PartialContentComponent <TContentData>
PartialContentController<TContentData>
Inherited Members
Namespace: EPiServer.Web.Mvc
Assembly: EPiServer.Cms.AspNetCore.Mvc.dll
Version: 12.0.3Syntax
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 |
---|---|---|
TContent |
currentContent | The current content instance. |
Returns
Type | Description |
---|---|
Microsoft. |
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 |
---|---|---|
TContent |
currentContent | The current content instance. |
Returns
Type | Description |
---|---|
Microsoft. |
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 |
---|---|---|
TContent |
currentContent | The content to render through a view |
Returns
Type | Description |
---|---|
Microsoft. |
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. |
viewName | The name of the view to use |
TContent |
currentContent | The content to render through a view |
Returns
Type | Description |
---|---|
Microsoft. |
The view result |