Table of Contents

Class PreviewController

Namespace
Umbraco.Cms.Web.BackOffice.Controllers
Assembly
Umbraco.Web.BackOffice.dll
[Area("UmbracoBackOffice")]
public class PreviewController : Controller, IActionFilter, IAsyncActionFilter, IFilterMetadata, IDisposable
Inheritance
PreviewController
Implements
Inherited Members

Constructors

PreviewController(UmbracoFeatures, IOptionsSnapshot<GlobalSettings>, IPublishedSnapshotService, IBackOfficeSecurityAccessor, ILocalizationService, IHostingEnvironment, ICookieManager, IRuntimeMinifier, ICompositeViewEngine, IUmbracoContextAccessor)

public PreviewController(UmbracoFeatures features, IOptionsSnapshot<GlobalSettings> globalSettings, IPublishedSnapshotService publishedSnapshotService, IBackOfficeSecurityAccessor backofficeSecurityAccessor, ILocalizationService localizationService, IHostingEnvironment hostingEnvironment, ICookieManager cookieManager, IRuntimeMinifier runtimeMinifier, ICompositeViewEngine viewEngines, IUmbracoContextAccessor umbracoContextAccessor)

Parameters

features UmbracoFeatures
globalSettings IOptionsSnapshot<GlobalSettings>
publishedSnapshotService IPublishedSnapshotService
backofficeSecurityAccessor IBackOfficeSecurityAccessor
localizationService ILocalizationService
hostingEnvironment IHostingEnvironment
cookieManager ICookieManager
runtimeMinifier IRuntimeMinifier
viewEngines ICompositeViewEngine
umbracoContextAccessor IUmbracoContextAccessor

Methods

Application()

Returns the JavaScript file for preview

[MinifyJavaScriptResult(Order = 0)]
public Task<JavaScriptResult> Application()

Returns

Task<JavaScriptResult>

End(string?)

public ActionResult End(string? redir = null)

Parameters

redir string

Returns

ActionResult

EnterPreview(int)

public ActionResult? EnterPreview(int id)

Parameters

id int

Returns

ActionResult

Frame(int, string)

The endpoint that is loaded within the preview iframe

[Authorize(Policy = "BackOfficeAccess")]
public ActionResult Frame(int id, string culture)

Parameters

id int
culture string

Returns

ActionResult

Index(int?)

[Authorize(Policy = "BackOfficeAccessWithoutApproval")]
public ActionResult Index(int? id = null)

Parameters

id int?

Returns

ActionResult