Class RazorPageExtensions

Version: 21.x

Extensions to support Razor pages and views.

Inheritance
System.Object
RazorPageExtensions
Namespace: Sitecore.AspNet.RenderingEngine.Extensions
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
RequestResponse
public static class RazorPageExtensions : Object

Methods

SitecoreComponent(IRazorPage)

Gets the current Sitecore Component.

Declaration
RequestResponse
public static Component SitecoreComponent(this IRazorPage page)
Parameters
TypeNameDescription
Microsoft.AspNetCore.Mvc.Razor.IRazorPagepage

The current Microsoft.AspNetCore.Mvc.Razor.IRazorPage.

Returns
TypeDescription
Component

The current instance of Component.

SitecoreContext(IRazorPage)

Gets the current Sitecore Context.

Declaration
RequestResponse
public static Context SitecoreContext(this IRazorPage page)
Parameters
TypeNameDescription
Microsoft.AspNetCore.Mvc.Razor.IRazorPagepage

The current Microsoft.AspNetCore.Mvc.Razor.IRazorPage.

Returns
TypeDescription
Context

The current instance of Context.

SitecoreRoute(IRazorPage)

Gets the current Sitecore Route data.

Declaration
RequestResponse
public static Route SitecoreRoute(this IRazorPage page)
Parameters
TypeNameDescription
Microsoft.AspNetCore.Mvc.Razor.IRazorPagepage

The current Microsoft.AspNetCore.Mvc.Razor.IRazorPage.

Returns
TypeDescription
Route

The current instance of Route.

Do you have some feedback for us?

If you have suggestions for improving this article,