Search Results for

    Show / Hide Table of Contents
    View Source

    Class HtmlHelperRenderExtensions

    HtmlHelper extensions for use in templates

    Inheritance
    object
    Namespace: Umbraco.Extensions
    Assembly: Umbraco.Web.Website.dll
    Syntax
    public static class HtmlHelperRenderExtensions

    Methods

    View Source

    ActionLink(IHtmlHelper, string, Type)

    Returns the result of a child action of a SurfaceController

    Declaration
    public static IHtmlContent ActionLink(this IHtmlHelper htmlHelper, string actionName, Type surfaceType)
    Parameters
    Type Name Description
    IHtmlHelper htmlHelper
    string actionName
    Type surfaceType
    Returns
    Type Description
    IHtmlContent
    View Source

    ActionLink<T>(IHtmlHelper, string)

    Returns the result of a child action of a strongly typed SurfaceController

    Declaration
    public static IHtmlContent ActionLink<T>(this IHtmlHelper htmlHelper, string actionName) where T : SurfaceController
    Parameters
    Type Name Description
    IHtmlHelper htmlHelper
    string actionName
    Returns
    Type Description
    IHtmlContent
    Type Parameters
    Name Description
    T

    The SurfaceController

    View Source

    AreaPartial(IHtmlHelper, string, string, object?, ViewDataDictionary?)

    Renders a partial view that is found in the specified area

    Declaration
    public static IHtmlContent AreaPartial(this IHtmlHelper helper, string partial, string area, object? model = null, ViewDataDictionary? viewData = null)
    Parameters
    Type Name Description
    IHtmlHelper helper
    string partial
    string area
    object model
    ViewDataDictionary viewData
    Returns
    Type Description
    IHtmlContent
    View Source

    BeginUmbracoForm(IHtmlHelper, string, string)

    Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string controllerName)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    string controllerName
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, string, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller.

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string controllerName, FormMethod method)
    Parameters
    Type Name Description
    IHtmlHelper html

    The HTML helper.

    string action

    Name of the action.

    string controllerName

    Name of the controller.

    FormMethod method

    The method.

    Returns
    Type Description
    MvcForm

    the Microsoft.AspNetCore.Mvc.Rendering.MvcForm

    View Source

    BeginUmbracoForm(IHtmlHelper, string, string, object?)

    Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string controllerName, object? additionalRouteVals = null)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    string controllerName
    object additionalRouteVals
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, string, object?, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string controllerName, object? additionalRouteVals, FormMethod method)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    string controllerName
    object additionalRouteVals
    FormMethod method
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, string, object?, IDictionary<string, object?>)

    Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string controllerName, object? additionalRouteVals, IDictionary<string, object?> htmlAttributes)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    string controllerName
    object additionalRouteVals
    IDictionary<string, object> htmlAttributes
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, string, object?, IDictionary<string, object?>, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string controllerName, object? additionalRouteVals, IDictionary<string, object?> htmlAttributes, FormMethod method)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    string controllerName
    object additionalRouteVals
    IDictionary<string, object> htmlAttributes
    FormMethod method
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, string, object?, bool?, IDictionary<string, object?>, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string controllerName, object? additionalRouteVals, bool? antiforgery, IDictionary<string, object?> htmlAttributes, FormMethod method)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    string controllerName
    object additionalRouteVals
    bool? antiforgery
    IDictionary<string, object> htmlAttributes
    FormMethod method
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, string, object?, object)

    Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string controllerName, object? additionalRouteVals, object htmlAttributes)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    string controllerName
    object additionalRouteVals
    object htmlAttributes
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, string, object?, object, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string controllerName, object? additionalRouteVals, object htmlAttributes, FormMethod method)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    string controllerName
    object additionalRouteVals
    object htmlAttributes
    FormMethod method
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, string, string)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string controllerName, string area)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    string controllerName
    string area
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, string, string, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string controllerName, string area, FormMethod method)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    string controllerName
    string area
    FormMethod method
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, string, string, object?, IDictionary<string, object?>)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string controllerName, string area, object? additionalRouteVals, IDictionary<string, object?> htmlAttributes)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    string controllerName
    string area
    object additionalRouteVals
    IDictionary<string, object> htmlAttributes
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, string?, string, object?, IDictionary<string, object?>, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string? controllerName, string area, object? additionalRouteVals, IDictionary<string, object?> htmlAttributes, FormMethod method)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    string controllerName
    string area
    object additionalRouteVals
    IDictionary<string, object> htmlAttributes
    FormMethod method
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, string?, string, object?, bool?, IDictionary<string, object?>, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, string? controllerName, string area, object? additionalRouteVals, bool? antiforgery, IDictionary<string, object?> htmlAttributes, FormMethod method)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    string controllerName
    string area
    object additionalRouteVals
    bool? antiforgery
    IDictionary<string, object> htmlAttributes
    FormMethod method
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, Type)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, Type surfaceType)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    Type surfaceType
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, Type, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, Type surfaceType, FormMethod method)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    Type surfaceType
    FormMethod method
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, Type, object?)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, Type surfaceType, object? additionalRouteVals = null)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    Type surfaceType
    object additionalRouteVals
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, Type, object?, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, Type surfaceType, object? additionalRouteVals, FormMethod method)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    Type surfaceType
    object additionalRouteVals
    FormMethod method
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, Type, object?, IDictionary<string, object?>)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, Type surfaceType, object? additionalRouteVals, IDictionary<string, object?> htmlAttributes)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    Type surfaceType
    object additionalRouteVals
    IDictionary<string, object> htmlAttributes
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, Type, object?, IDictionary<string, object?>, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, Type surfaceType, object? additionalRouteVals, IDictionary<string, object?> htmlAttributes, FormMethod method)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    Type surfaceType
    object additionalRouteVals
    IDictionary<string, object> htmlAttributes
    FormMethod method
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, Type, object?, bool?, IDictionary<string, object?>, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, Type surfaceType, object? additionalRouteVals, bool? antiforgery, IDictionary<string, object?> htmlAttributes, FormMethod method)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    Type surfaceType
    object additionalRouteVals
    bool? antiforgery
    IDictionary<string, object> htmlAttributes
    FormMethod method
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, Type, object?, object)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, Type surfaceType, object? additionalRouteVals, object htmlAttributes)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    Type surfaceType
    object additionalRouteVals
    object htmlAttributes
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, Type, object?, object, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, Type surfaceType, object? additionalRouteVals, object htmlAttributes, FormMethod method)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    Type surfaceType
    object additionalRouteVals
    object htmlAttributes
    FormMethod method
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm(IHtmlHelper, string, Type, object?, object, FormMethod, bool?)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm(this IHtmlHelper html, string action, Type surfaceType, object? additionalRouteVals, object htmlAttributes, FormMethod method, bool? antiforgery)
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    Type surfaceType
    object additionalRouteVals
    object htmlAttributes
    FormMethod method
    bool? antiforgery
    Returns
    Type Description
    MvcForm
    View Source

    BeginUmbracoForm<T>(IHtmlHelper, string)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm<T>(this IHtmlHelper html, string action) where T : SurfaceController
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    Returns
    Type Description
    MvcForm
    Type Parameters
    Name Description
    T

    The SurfaceController type

    View Source

    BeginUmbracoForm<T>(IHtmlHelper, string, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm<T>(this IHtmlHelper html, string action, FormMethod method) where T : SurfaceController
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    FormMethod method
    Returns
    Type Description
    MvcForm
    Type Parameters
    Name Description
    T

    The SurfaceController type

    View Source

    BeginUmbracoForm<T>(IHtmlHelper, string, FormMethod, bool?)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm<T>(this IHtmlHelper html, string action, FormMethod method, bool? antiforgery) where T : SurfaceController
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    FormMethod method
    bool? antiforgery
    Returns
    Type Description
    MvcForm
    Type Parameters
    Name Description
    T

    The SurfaceController type

    View Source

    BeginUmbracoForm<T>(IHtmlHelper, string, object?)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm<T>(this IHtmlHelper html, string action, object? additionalRouteVals = null) where T : SurfaceController
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    object additionalRouteVals
    Returns
    Type Description
    MvcForm
    Type Parameters
    Name Description
    T

    The SurfaceController type

    View Source

    BeginUmbracoForm<T>(IHtmlHelper, string, object?, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm<T>(this IHtmlHelper html, string action, object? additionalRouteVals, FormMethod method) where T : SurfaceController
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    object additionalRouteVals
    FormMethod method
    Returns
    Type Description
    MvcForm
    Type Parameters
    Name Description
    T

    The SurfaceController type

    View Source

    BeginUmbracoForm<T>(IHtmlHelper, string, object?, IDictionary<string, object?>)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm<T>(this IHtmlHelper html, string action, object? additionalRouteVals, IDictionary<string, object?> htmlAttributes) where T : SurfaceController
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    object additionalRouteVals
    IDictionary<string, object> htmlAttributes
    Returns
    Type Description
    MvcForm
    Type Parameters
    Name Description
    T

    The SurfaceController type

    View Source

    BeginUmbracoForm<T>(IHtmlHelper, string, object?, IDictionary<string, object?>, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm<T>(this IHtmlHelper html, string action, object? additionalRouteVals, IDictionary<string, object?> htmlAttributes, FormMethod method) where T : SurfaceController
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    object additionalRouteVals
    IDictionary<string, object> htmlAttributes
    FormMethod method
    Returns
    Type Description
    MvcForm
    Type Parameters
    Name Description
    T

    The SurfaceController type

    View Source

    BeginUmbracoForm<T>(IHtmlHelper, string, object?, object)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm<T>(this IHtmlHelper html, string action, object? additionalRouteVals, object htmlAttributes) where T : SurfaceController
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    object additionalRouteVals
    object htmlAttributes
    Returns
    Type Description
    MvcForm
    Type Parameters
    Name Description
    T
    View Source

    BeginUmbracoForm<T>(IHtmlHelper, string, object?, object, FormMethod)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm<T>(this IHtmlHelper html, string action, object? additionalRouteVals, object htmlAttributes, FormMethod method) where T : SurfaceController
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    object additionalRouteVals
    object htmlAttributes
    FormMethod method
    Returns
    Type Description
    MvcForm
    Type Parameters
    Name Description
    T

    The SurfaceController type

    View Source

    BeginUmbracoForm<T>(IHtmlHelper, string, object?, object, FormMethod, bool?)

    Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin

    Declaration
    public static MvcForm BeginUmbracoForm<T>(this IHtmlHelper html, string action, object? additionalRouteVals, object htmlAttributes, FormMethod method, bool? antiforgery) where T : SurfaceController
    Parameters
    Type Name Description
    IHtmlHelper html
    string action
    object additionalRouteVals
    object htmlAttributes
    FormMethod method
    bool? antiforgery
    Returns
    Type Description
    MvcForm
    Type Parameters
    Name Description
    T

    The SurfaceController type

    View Source

    CachedPartialAsync(IHtmlHelper, string, object, TimeSpan, bool, bool, ViewDataDictionary?, Func<object, ViewDataDictionary?, string>?)

    Declaration
    public static Task<IHtmlContent?> CachedPartialAsync(this IHtmlHelper htmlHelper, string partialViewName, object model, TimeSpan cacheTimeout, bool cacheByPage = false, bool cacheByMember = false, ViewDataDictionary? viewData = null, Func<object, ViewDataDictionary?, string>? contextualKeyBuilder = null)
    Parameters
    Type Name Description
    IHtmlHelper htmlHelper
    string partialViewName
    object model
    TimeSpan cacheTimeout
    bool cacheByPage
    bool cacheByMember
    ViewDataDictionary viewData
    Func<object, ViewDataDictionary, string> contextualKeyBuilder
    Returns
    Type Description
    Task<IHtmlContent>
    View Source

    Coalesce(IHtmlHelper, params object?[])

    Will take the first non-null value in the collection and return the value of it.

    Declaration
    public static string Coalesce(this IHtmlHelper helper, params object?[] args)
    Parameters
    Type Name Description
    IHtmlHelper helper
    object[] args
    Returns
    Type Description
    string
    View Source

    Concatenate(IHtmlHelper, params object[])

    Joins any number of int/string/objects into one string

    Declaration
    public static string Concatenate(this IHtmlHelper helper, params object[] args)
    Parameters
    Type Name Description
    IHtmlHelper helper
    object[] args
    Returns
    Type Description
    string
    View Source

    CreateHash(IHtmlHelper, string)

    Generates a hash based on the text string passed in. This method will detect the security requirements (is FIPS enabled) and return an appropriate hash.

    Declaration
    public static string CreateHash(this IHtmlHelper helper, string text)
    Parameters
    Type Name Description
    IHtmlHelper helper

    The Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper

    string text

    The text to create a hash from

    Returns
    Type Description
    string

    Hash of the text string

    View Source

    If(IHtmlHelper, bool, string)

    If test is true, the HTML encoded valueIfTrue will be returned; otherwise, string.Empty.

    Declaration
    public static IHtmlContent If(this IHtmlHelper html, bool test, string valueIfTrue)
    Parameters
    Type Name Description
    IHtmlHelper html

    The HTML helper.

    bool test

    If set to true returns valueIfTrue; otherwise, string.Empty.

    string valueIfTrue

    The value if true.

    Returns
    Type Description
    IHtmlContent

    The HTML encoded value.

    View Source

    If(IHtmlHelper, bool, string, string)

    If test is true, the HTML encoded valueIfTrue will be returned; otherwise, valueIfFalse.

    Declaration
    public static IHtmlContent If(this IHtmlHelper html, bool test, string valueIfTrue, string valueIfFalse)
    Parameters
    Type Name Description
    IHtmlHelper html

    The HTML helper.

    bool test

    If set to true returns valueIfTrue; otherwise, valueIfFalse.

    string valueIfTrue

    The value if true.

    string valueIfFalse

    The value if false.

    Returns
    Type Description
    IHtmlContent

    The HTML encoded value.

    View Source

    Join(IHtmlHelper, string, params object[])

    Joins any number of int/string/objects into one string and separates them with the string separator parameter.

    Declaration
    public static string Join(this IHtmlHelper helper, string separator, params object[] args)
    Parameters
    Type Name Description
    IHtmlHelper helper
    string separator
    object[] args
    Returns
    Type Description
    string
    View Source

    PreviewBadge(IHtmlHelper, IUmbracoContextAccessor, IHttpContextAccessor, GlobalSettings, IIOHelper, ContentSettings)

    Will render the preview badge when in preview mode which is not required ever unless the MVC page you are using does not inherit from UmbracoViewPage

    Declaration
    public static IHtmlContent PreviewBadge(this IHtmlHelper helper, IUmbracoContextAccessor umbracoContextAccessor, IHttpContextAccessor httpContextAccessor, GlobalSettings globalSettings, IIOHelper ioHelper, ContentSettings contentSettings)
    Parameters
    Type Name Description
    IHtmlHelper helper
    IUmbracoContextAccessor umbracoContextAccessor
    IHttpContextAccessor httpContextAccessor
    GlobalSettings globalSettings
    IIOHelper ioHelper
    ContentSettings contentSettings
    Returns
    Type Description
    IHtmlContent
    Remarks

    See: http://issues.umbraco.org/issue/U4-1614

    View Source

    RenderProfiler(IHtmlHelper)

    Renders the markup for the profiler

    Declaration
    public static IHtmlContent RenderProfiler(this IHtmlHelper helper)
    Parameters
    Type Name Description
    IHtmlHelper helper
    Returns
    Type Description
    IHtmlContent
    View Source

    ReplaceLineBreaks(IHtmlHelper, string)

    HTML encodes the text and replaces text line breaks with HTML line breaks.

    Declaration
    public static IHtmlContent ReplaceLineBreaks(this IHtmlHelper helper, string text)
    Parameters
    Type Name Description
    IHtmlHelper helper

    The HTML helper.

    string text

    The text.

    Returns
    Type Description
    IHtmlContent

    The HTML encoded text with text line breaks replaced with HTML line breaks (<br />).

    View Source

    StripHtml(IHtmlHelper, IHtmlContent, params string[])

    Strips all HTML tags from a given string, all contents of the tags will remain.

    Declaration
    public static IHtmlContent StripHtml(this IHtmlHelper helper, IHtmlContent html, params string[] tags)
    Parameters
    Type Name Description
    IHtmlHelper helper
    IHtmlContent html
    string[] tags
    Returns
    Type Description
    IHtmlContent
    View Source

    StripHtml(IHtmlHelper, string, params string[])

    Strips all HTML tags from a given string, all contents of the tags will remain.

    Declaration
    public static IHtmlContent StripHtml(this IHtmlHelper helper, string html, params string[] tags)
    Parameters
    Type Name Description
    IHtmlHelper helper
    string html
    string[] tags
    Returns
    Type Description
    IHtmlContent
    View Source

    SurfaceControllerHiddenInput<TSurface>(IHtmlHelper, string, string, object?)

    Outputs the hidden html input field for Surface Controller route information

    Declaration
    public static IHtmlContent SurfaceControllerHiddenInput<TSurface>(this IHtmlHelper htmlHelper, string controllerAction, string area, object? additionalRouteVals = null) where TSurface : SurfaceController
    Parameters
    Type Name Description
    IHtmlHelper htmlHelper
    string controllerAction
    string area
    object additionalRouteVals
    Returns
    Type Description
    IHtmlContent
    Type Parameters
    Name Description
    TSurface

    The SurfaceController type

    Remarks

    Typically not used directly because BeginUmbracoForm automatically outputs this value when routing for surface controllers. But this could be used in case a form tag is manually created.

    View Source

    Truncate(IHtmlHelper, IHtmlContent, int)

    Truncates a string to a given length, can add a ellipsis at the end (...). Method checks for open HTML tags, and makes sure to close them

    Declaration
    public static IHtmlContent Truncate(this IHtmlHelper helper, IHtmlContent html, int length)
    Parameters
    Type Name Description
    IHtmlHelper helper
    IHtmlContent html
    int length
    Returns
    Type Description
    IHtmlContent
    View Source

    Truncate(IHtmlHelper, IHtmlContent, int, bool)

    Truncates a string to a given length, can add a ellipsis at the end (...). Method checks for open HTML tags, and makes sure to close them

    Declaration
    public static IHtmlContent Truncate(this IHtmlHelper helper, IHtmlContent html, int length, bool addElipsis)
    Parameters
    Type Name Description
    IHtmlHelper helper
    IHtmlContent html
    int length
    bool addElipsis
    Returns
    Type Description
    IHtmlContent
    View Source

    Truncate(IHtmlHelper, IHtmlContent, int, bool, bool)

    Truncates a string to a given length, can add a ellipsis at the end (...). Method checks for open HTML tags, and makes sure to close them

    Declaration
    public static IHtmlContent Truncate(this IHtmlHelper helper, IHtmlContent html, int length, bool addElipsis, bool treatTagsAsContent)
    Parameters
    Type Name Description
    IHtmlHelper helper
    IHtmlContent html
    int length
    bool addElipsis
    bool treatTagsAsContent
    Returns
    Type Description
    IHtmlContent
    View Source

    Truncate(IHtmlHelper, string, int)

    Truncates a string to a given length, can add a ellipsis at the end (...). Method checks for open HTML tags, and makes sure to close them

    Declaration
    public static IHtmlContent Truncate(this IHtmlHelper helper, string html, int length)
    Parameters
    Type Name Description
    IHtmlHelper helper
    string html
    int length
    Returns
    Type Description
    IHtmlContent
    View Source

    Truncate(IHtmlHelper, string, int, bool)

    Truncates a string to a given length, can add a ellipsis at the end (...). Method checks for open HTML tags, and makes sure to close them

    Declaration
    public static IHtmlContent Truncate(this IHtmlHelper helper, string html, int length, bool addElipsis)
    Parameters
    Type Name Description
    IHtmlHelper helper
    string html
    int length
    bool addElipsis
    Returns
    Type Description
    IHtmlContent
    View Source

    Truncate(IHtmlHelper, string, int, bool, bool)

    Truncates a string to a given length, can add a ellipsis at the end (...). Method checks for open HTML tags, and makes sure to close them

    Declaration
    public static IHtmlContent Truncate(this IHtmlHelper helper, string html, int length, bool addElipsis, bool treatTagsAsContent)
    Parameters
    Type Name Description
    IHtmlHelper helper
    string html
    int length
    bool addElipsis
    bool treatTagsAsContent
    Returns
    Type Description
    IHtmlContent
    View Source

    TruncateByWords(IHtmlHelper, IHtmlContent, int)

    Truncates a string to a given amount of words, can add a ellipsis at the end (...). Method checks for open HTML tags, and makes sure to close them

    Declaration
    public static IHtmlContent TruncateByWords(this IHtmlHelper helper, IHtmlContent html, int words)
    Parameters
    Type Name Description
    IHtmlHelper helper
    IHtmlContent html
    int words
    Returns
    Type Description
    IHtmlContent
    View Source

    TruncateByWords(IHtmlHelper, IHtmlContent, int, bool)

    Truncates a string to a given amount of words, can add a ellipsis at the end (...). Method checks for open HTML tags, and makes sure to close them

    Declaration
    public static IHtmlContent TruncateByWords(this IHtmlHelper helper, IHtmlContent html, int words, bool addElipsis)
    Parameters
    Type Name Description
    IHtmlHelper helper
    IHtmlContent html
    int words
    bool addElipsis
    Returns
    Type Description
    IHtmlContent
    View Source

    TruncateByWords(IHtmlHelper, string, int)

    Truncates a string to a given amount of words, can add a ellipsis at the end (...). Method checks for open HTML tags, and makes sure to close them

    Declaration
    public static IHtmlContent TruncateByWords(this IHtmlHelper helper, string html, int words)
    Parameters
    Type Name Description
    IHtmlHelper helper
    string html
    int words
    Returns
    Type Description
    IHtmlContent
    View Source

    TruncateByWords(IHtmlHelper, string, int, bool)

    Truncates a string to a given amount of words, can add a ellipsis at the end (...). Method checks for open HTML tags, and makes sure to close them

    Declaration
    public static IHtmlContent TruncateByWords(this IHtmlHelper helper, string html, int words, bool addElipsis)
    Parameters
    Type Name Description
    IHtmlHelper helper
    string html
    int words
    bool addElipsis
    Returns
    Type Description
    IHtmlContent
    View Source

    ValidationSummary(IHtmlHelper, string, bool, string, object?)

    A validation summary that lets you pass in a prefix so that the summary only displays for elements containing the prefix. This allows you to have more than on validation summary on a page.

    Declaration
    public static IHtmlContent ValidationSummary(this IHtmlHelper htmlHelper, string prefix = "", bool excludePropertyErrors = false, string message = "", object? htmlAttributes = null)
    Parameters
    Type Name Description
    IHtmlHelper htmlHelper
    string prefix
    bool excludePropertyErrors
    string message
    object htmlAttributes
    Returns
    Type Description
    IHtmlContent
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX