Table of Contents

Class ComponentExtensions

Namespace
Dynamicweb.CoreUI.Rendering
Assembly
Dynamicweb.CoreUI.Rendering.dll

Extension methods for simplification of Dynamicweb component rendering

public static class ComponentExtensions
Inheritance
ComponentExtensions
Inherited Members

Methods

EncodePath(IHtmlHelper, string?)

public static string? EncodePath(this IHtmlHelper html, string? value)

Parameters

html IHtmlHelper
value string

Returns

string

EncodeUrl(IHtmlHelper, string?)

public static string? EncodeUrl(this IHtmlHelper html, string? url)

Parameters

html IHtmlHelper
url string

Returns

string

GetUniqueId(IHtmlHelper, object?)

public static string GetUniqueId(this IHtmlHelper _, object? model = null)

Parameters

_ IHtmlHelper
model object

Returns

string

Icon(IViewComponentHelper, Icon?, Dictionary<string, string>?, Size)

public static Task<IHtmlContent?> Icon(this IViewComponentHelper viewComponentHelper, Icon? icon, Dictionary<string, string>? attributes = null, Size size = Size.Small)

Parameters

viewComponentHelper IViewComponentHelper
icon Icon
attributes Dictionary<string, string>
size Size

Returns

Task<IHtmlContent>

RenderComponentPartial<TModel>(IHtmlHelper, string, TModel)

public static Task<IHtmlContent?> RenderComponentPartial<TModel>(this IHtmlHelper html, string partialName, TModel model)

Parameters

html IHtmlHelper
partialName string
model TModel

Returns

Task<IHtmlContent>

Type Parameters

TModel

RenderComponentizedListOption(IHtmlHelper, ComponentizedListOption?)

public static Task<IHtmlContent?> RenderComponentizedListOption(this IHtmlHelper html, ListBase.ComponentizedListOption? option)

Parameters

html IHtmlHelper
option ListBase.ComponentizedListOption

Returns

Task<IHtmlContent>

RenderDynamicwebScreenWrapper(IViewComponentHelper, ScreenTypeBase)

public static Task<IHtmlContent?> RenderDynamicwebScreenWrapper(this IViewComponentHelper viewComponentHelper, ScreenTypeBase screenType)

Parameters

viewComponentHelper IViewComponentHelper
screenType ScreenTypeBase

Returns

Task<IHtmlContent>

RenderDynamicwebUiComponent(IViewComponentHelper, UiComponentBase?)

Renders the passed Dynamicweb UiComponent as a model in a view with the same name as the fully qualified name of the viewmodel.

public static Task<IHtmlContent?> RenderDynamicwebUiComponent(this IViewComponentHelper viewComponentHelper, UiComponentBase? viewModel)

Parameters

viewComponentHelper IViewComponentHelper

The viewcomponent helper of the view calling this extension. This is an extension method

viewModel UiComponentBase

An instance of a UiComponentBase model to be rendered

Returns

Task<IHtmlContent>

A IHtmlContent response of the rendered model using the

Remarks

The view to render the model is located by convention. If the model is Text the view rendering the model is /Views/Shared/Components/UiComponentWrapper/Dynamicweb.CoreUI.Editors.Inputs.Text.cshtml

RenderDynamicwebUiComponent(IViewComponentHelper, UiComponentBase?, Dictionary<string, string>?)

public static Task<IHtmlContent?> RenderDynamicwebUiComponent(this IViewComponentHelper viewComponentHelper, UiComponentBase? viewModel, Dictionary<string, string>? attributes)

Parameters

viewComponentHelper IViewComponentHelper
viewModel UiComponentBase
attributes Dictionary<string, string>

Returns

Task<IHtmlContent>

ToJson(IHtmlHelper, object?, bool)

public static IHtmlContent ToJson(this IHtmlHelper html, object? input, bool useApiSerializerOptions = false)

Parameters

html IHtmlHelper
input object
useApiSerializerOptions bool

Returns

IHtmlContent
To top