Class RazorPageExtensions
Extension methods for Microsoft.AspNetCore.Mvc.Razor.RazorPage
Inheritance
object
Namespace: Umbraco.Extensions
Assembly: Umbraco.Web.Common.dll
Syntax
public static class RazorPageExtensions
Methods
View SourceRenderSection(RazorPage, string, HtmlString)
Renders a section with default content if the section isn't defined
Declaration
public static HtmlString? RenderSection(this RazorPage webPage, string name, HtmlString defaultContents)
Parameters
| Type | Name | Description |
|---|---|---|
| RazorPage | webPage | |
| string | name | |
| HtmlString | defaultContents |
Returns
| Type | Description |
|---|---|
| HtmlString |
RenderSection(RazorPage, string, string)
Renders a section with default content if the section isn't defined
Declaration
public static HtmlString? RenderSection(this RazorPage webPage, string name, string defaultContents)
Parameters
| Type | Name | Description |
|---|---|---|
| RazorPage | webPage | |
| string | name | |
| string | defaultContents |
Returns
| Type | Description |
|---|---|
| HtmlString |