SaaS CMS has officially launched! Learn more now.

Class HtmlHelperExtensions

Uncategorized html helper extensions

Inheritance
System.Object
HtmlHelperExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Shell.Web.Mvc.Html
Assembly: EPiServer.Shell.dll
Version: 7.19.2
Syntax
public static class HtmlHelperExtensions

Methods

Anchor(HtmlHelper, String, String, String, String)

Creates an anchor with the given attributes.

Declaration
public static TagBuilder Anchor(this HtmlHelper html, string href, string target, string title, string text)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper html

The html helper to append the extension method to.

System.String href

The url to link to.

System.String target

The target frame.

System.String title

The title/tool tip.

System.String text

The link text.

Returns
Type Description
System.Web.Mvc.TagBuilder

A loaded tag builder.

Anchor(HtmlHelper, String, String, String, String, Int32)

Creates an anchor with the given attributes.

Declaration
public static TagBuilder Anchor(this HtmlHelper html, string href, string target, string title, string text, int maxTextLength)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper html

The html helper to append the extension method to.

System.String href

The url to link to.

System.String target

The target frame.

System.String title

The title/tool tip.

System.String text

The link text.

System.Int32 maxTextLength

The maximum length of the link.

Returns
Type Description
System.Web.Mvc.TagBuilder

A loaded tag builder.

AutoUpdate(HtmlHelper, Int32)

Adds autoupdate feature on the gadget (also is possible from the gadget js options)

Declaration
public static string AutoUpdate(this HtmlHelper html, int delay)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper html

The HTML.

System.Int32 delay

Delay in milliseconds

Returns
Type Description
System.String

Span which saves value for autoupdate

AutoUpdate(HtmlHelper, Int32, String)

Adds autoupdate feature on the gadget.

Declaration
public static string AutoUpdate(this HtmlHelper html, int delay, string actionName)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper html

The HTML

System.Int32 delay

Delay in milliseconds

System.String actionName

The name of the action to call on autoupdate

Returns
Type Description
System.String

Span which saves value for autoupdate

AutoUpdate(HtmlHelper, TimeSpan)

Adds autoupdate feature on the gadget (also is possible from the gadget js options)

Declaration
public static string AutoUpdate(this HtmlHelper html, TimeSpan delay)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper html

The HTML.

System.TimeSpan delay

Time span for delay

Returns
Type Description
System.String

Span which saves value for autoupdate

AutoUpdate(HtmlHelper, TimeSpan, String)

Adds autoupdate feature on the gadget (also is possible from the gadget js options)

Declaration
public static string AutoUpdate(this HtmlHelper html, TimeSpan delay, string actionName)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper html

The HTML.

System.TimeSpan delay

Time span for delay

System.String actionName

The name of the action to call on autoupdate

Returns
Type Description
System.String

Span which saves value for autoupdate

Paging(HtmlHelper, Pager, String)

Creates paging html elements.

Declaration
public static string Paging(this HtmlHelper html, Pager status, string action)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper html

The object this method is attached to

Pager status

The paging status.

System.String action

The action that should be executed when a paging item is selected.

Returns
Type Description
System.String

Html containing paging elements.

Paging(HtmlHelper, Pager, String, Object)

Creates paging html elements.

Declaration
public static string Paging(this HtmlHelper html, Pager status, string action, object routeValues)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper html

The object this method is attached to

Pager status

The paging status.

System.String action

The action that should be executed when a paging item is selected.

System.Object routeValues

The route values.

Returns
Type Description
System.String

Html containing paging elements.

RenderTableRows(HtmlHelper, IEnumerable, String[])

Renders the given data objects into a table row elements.

Declaration
public static void RenderTableRows(this HtmlHelper html, IEnumerable tableRows, params string[] tableProperties)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper html

The HTML.

System.Collections.IEnumerable tableRows

The table rows.

System.String[] tableProperties

The table properties.

ShellLinkButton(HtmlHelper, String, String, String, String, String)

Creates a anchor with surrounding spans to emulate the look of ShellButtons.

Declaration
public static string ShellLinkButton(this HtmlHelper html, string href, string target, string title, string text, string cssClass)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper html

The HTML.

System.String href

The href.

System.String target

The target.

System.String title

The title.

System.String text

The text.

System.String cssClass

The CSS class.

Returns
Type Description
System.String

An html string representing the anchor.

ShellLinkButton(HtmlHelper, String, String, String, String, String, Object)

Creates a anchor with surrounding spans to emulate the look of ShellButtons.

Declaration
public static string ShellLinkButton(this HtmlHelper html, string href, string target, string title, string text, string cssClass, object htmlAttributes)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper html

The HTML.

System.String href

The href.

System.String target

The target.

System.String title

The title.

System.String text

The text.

System.String cssClass

The CSS class.

System.Object htmlAttributes

Any extra html attribute that should be added to the tag.

Returns
Type Description
System.String

An html string representing the anchor.

ShellValidationSummary(HtmlHelper)

Will wrap the standard asp.net validation summary with a div with the css class .epi-gadgetFeedback.

Declaration
public static string ShellValidationSummary(this HtmlHelper htmlHelper)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper htmlHelper

The HTML helper this method is attached to.

Returns
Type Description
System.String

The standard asp.net validation summary surrounded by a div with the css class .epi-gadgetFeedback.

Tag(HtmlHelper, String, String)

Creates a tag builder with a css class.

Declaration
public static TagBuilder Tag(this HtmlHelper htmlHelper, string tagName, string cssClass)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper htmlHelper
System.String tagName

The html tag name

System.String cssClass

The css class to assign the tag

Returns
Type Description
System.Web.Mvc.TagBuilder

A tag builder