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 : ObjectMethods
SitecoreComponent(IRazorPage)
Gets the current Sitecore Component.
Declaration
RequestResponse
public static Component SitecoreComponent(this IRazorPage page)Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Mvc.Razor.IRazorPage | page |
The current Microsoft.AspNetCore.Mvc.Razor.IRazorPage. |
Returns
SitecoreContext(IRazorPage)
Gets the current Sitecore Context.
Declaration
RequestResponse
public static Context SitecoreContext(this IRazorPage page)Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Mvc.Razor.IRazorPage | page |
The current Microsoft.AspNetCore.Mvc.Razor.IRazorPage. |
Returns
SitecoreRoute(IRazorPage)
Gets the current Sitecore Route data.
Declaration
RequestResponse
public static Route SitecoreRoute(this IRazorPage page)Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Mvc.Razor.IRazorPage | page |
The current Microsoft.AspNetCore.Mvc.Razor.IRazorPage. |