Skip to main content

HtmlExtensions

Assembly: ServiceStack.Razor.dll
View Source
Declaration
public static class HtmlExtensions

Methods

AsRawJson<T>(T)

View Source
Declaration
public static MvcHtmlString AsRawJson<T>(this T model)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
<T>model
Type Parameters
  • T

AsRaw<T>(T)

View Source
Declaration
public static MvcHtmlString AsRaw<T>(this T model)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
<T>model
Type Parameters
  • T

GetRequest(HtmlHelper)

View Source
Declaration
public static IRequest GetRequest(this HtmlHelper html)
Returns

IRequest

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml

ToHtmlString(String)

View Source
Declaration
public static HtmlString ToHtmlString(this string str)
Returns

System.Web.HtmlString

Parameters
TypeName
System.Stringstr

GetItem(HtmlHelper, String)

View Source
Declaration
public static object GetItem(this HtmlHelper html, string key)
Returns

System.Object

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringkey

GetErrorStatus(HtmlHelper)

View Source
Declaration
public static ResponseStatus GetErrorStatus(this HtmlHelper html)
Returns

ResponseStatus

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml

HasErrorStatus(HtmlHelper)

View Source
Declaration
public static bool HasErrorStatus(this HtmlHelper html)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml

Form(HtmlHelper, String)

View Source
Declaration
public static string Form(this HtmlHelper html, string name)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname

Query(HtmlHelper, String)

View Source
Declaration
public static string Query(this HtmlHelper html, string name)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname

FormQuery(HtmlHelper, String)

View Source
Declaration
public static string FormQuery(this HtmlHelper html, string name)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname

FormQueryValues(HtmlHelper, String)

View Source
Declaration
public static string[] FormQueryValues(this HtmlHelper html, string name)
Returns

System.String[]

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname

FormValue(HtmlHelper, String)

View Source
Declaration
public static string FormValue(this HtmlHelper html, string name)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname

FormValue(HtmlHelper, String, String)

View Source
Declaration
public static string FormValue(this HtmlHelper html, string name, string defaultValue)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname
System.StringdefaultValue

FormValues(HtmlHelper, String)

View Source
Declaration
public static string[] FormValues(this HtmlHelper html, string name)
Returns

System.String[]

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname

FormCheckValue(HtmlHelper, String)

View Source
Declaration
public static bool FormCheckValue(this HtmlHelper html, string name)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname

GetParam(HtmlHelper, String)

View Source
Declaration
public static string GetParam(this HtmlHelper html, string name)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname

ErrorResponseExcept(HtmlHelper, String)

View Source
Declaration
public static string ErrorResponseExcept(this HtmlHelper html, string fieldNames)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.StringfieldNames

ErrorResponseExcept(HtmlHelper, ICollection<String>)

View Source
Declaration
public static string ErrorResponseExcept(this HtmlHelper html, ICollection<string> fieldNames)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.ICollection<System.String>fieldNames

ErrorResponseSummary(HtmlHelper)

View Source
Declaration
public static string ErrorResponseSummary(this HtmlHelper html)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml

ErrorResponse(HtmlHelper, String)

View Source
Declaration
public static string ErrorResponse(this HtmlHelper html, string fieldName)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.StringfieldName

UserProfileUrl(HtmlHelper)

View Source
Declaration
public static string UserProfileUrl(this HtmlHelper html)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml

ErrorSummary(HtmlHelper, String)

Alias for ServiceStack Html.ValidationSummary() with comma-delimited field names

View Source
Declaration
public static HtmlString ErrorSummary(this HtmlHelper html, string exceptFor)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.StringexceptFor

ErrorSummary(HtmlHelper)

View Source
Declaration
public static HtmlString ErrorSummary(this HtmlHelper html)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml

ValidationSummary(HtmlHelper, ICollection<String>)

View Source
Declaration
public static HtmlString ValidationSummary(this HtmlHelper html, ICollection<string> exceptFields)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.ICollection<System.String>exceptFields

ValidationSummary(HtmlHelper, ICollection<String>, Dictionary<String, Object>)

View Source
Declaration
public static HtmlString ValidationSummary(this HtmlHelper html, ICollection<string> exceptFields, Dictionary<string, object> divAttrs)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.ICollection<System.String>exceptFields
System.Collections.Generic.Dictionary<System.String,System.Object>divAttrs

ValidationSummary(HtmlHelper, ICollection<String>, Object)

View Source
Declaration
public static HtmlString ValidationSummary(this HtmlHelper html, ICollection<string> exceptFields, object divAttrs)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.ICollection<System.String>exceptFields
System.ObjectdivAttrs

HiddenInputs(HtmlHelper, IEnumerable<KeyValuePair<String, String>>)

View Source
Declaration
public static HtmlString HiddenInputs(this HtmlHelper html, IEnumerable<KeyValuePair<string, string>> kvps)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.String>>kvps

HiddenInputs(HtmlHelper, IEnumerable<KeyValuePair<String, Object>>)

View Source
Declaration
public static HtmlString HiddenInputs(this HtmlHelper html, IEnumerable<KeyValuePair<string, object>> kvps)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>>kvps

HiddenInputs(HtmlHelper, Object)

View Source
Declaration
public static HtmlString HiddenInputs(this HtmlHelper html, object kvps)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Objectkvps

FormTextarea(HtmlHelper, Object)

View Source
Declaration
public static HtmlString FormTextarea(this HtmlHelper html, object inputAttrs)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.ObjectinputAttrs

FormTextarea(HtmlHelper, Dictionary<String, Object>)

View Source
Declaration
public static HtmlString FormTextarea(this HtmlHelper html, Dictionary<string, object> inputAttrs)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.Dictionary<System.String,System.Object>inputAttrs

FormTextarea(HtmlHelper, Object, InputOptions)

View Source
Declaration
public static HtmlString FormTextarea(this HtmlHelper html, object inputAttrs, InputOptions inputOptions)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.ObjectinputAttrs
ServiceStack.InputOptionsinputOptions

FormTextarea(HtmlHelper, Dictionary<String, Object>, InputOptions)

View Source
Declaration
public static HtmlString FormTextarea(this HtmlHelper html, Dictionary<string, object> inputAttrs, InputOptions inputOptions)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.Dictionary<System.String,System.Object>inputAttrs
ServiceStack.InputOptionsinputOptions

FormSelect(HtmlHelper, Object)

View Source
Declaration
public static HtmlString FormSelect(this HtmlHelper html, object inputAttrs)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.ObjectinputAttrs

FormSelect(HtmlHelper, Dictionary<String, Object>)

View Source
Declaration
public static HtmlString FormSelect(this HtmlHelper html, Dictionary<string, object> inputAttrs)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.Dictionary<System.String,System.Object>inputAttrs

FormSelect(HtmlHelper, Object, InputOptions)

View Source
Declaration
public static HtmlString FormSelect(this HtmlHelper html, object inputAttrs, InputOptions inputOptions)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.ObjectinputAttrs
ServiceStack.InputOptionsinputOptions

FormSelect(HtmlHelper, Dictionary<String, Object>, InputOptions)

View Source
Declaration
public static HtmlString FormSelect(this HtmlHelper html, Dictionary<string, object> inputAttrs, InputOptions inputOptions)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.Dictionary<System.String,System.Object>inputAttrs
ServiceStack.InputOptionsinputOptions

FormInput(HtmlHelper, Object)

View Source
Declaration
public static HtmlString FormInput(this HtmlHelper html, object inputAttrs)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.ObjectinputAttrs

FormInput(HtmlHelper, Dictionary<String, Object>)

View Source
Declaration
public static HtmlString FormInput(this HtmlHelper html, Dictionary<string, object> inputAttrs)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.Dictionary<System.String,System.Object>inputAttrs

FormInput(HtmlHelper, Object, InputOptions)

View Source
Declaration
public static HtmlString FormInput(this HtmlHelper html, object inputAttrs, InputOptions inputOptions)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.ObjectinputAttrs
ServiceStack.InputOptionsinputOptions

FormInput(HtmlHelper, Dictionary<String, Object>, InputOptions)

View Source
Declaration
public static HtmlString FormInput(this HtmlHelper html, Dictionary<string, object> inputAttrs, InputOptions inputOptions)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.Dictionary<System.String,System.Object>inputAttrs
ServiceStack.InputOptionsinputOptions

FormControl(HtmlHelper, Object, String, InputOptions)

View Source
Declaration
public static HtmlString FormControl(this HtmlHelper html, object inputAttrs, string tagName, InputOptions inputOptions)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.ObjectinputAttrs
System.StringtagName
ServiceStack.InputOptionsinputOptions

FormControl(HtmlHelper, Dictionary<String, Object>, String, InputOptions)

View Source
Declaration
public static HtmlString FormControl(this HtmlHelper html, Dictionary<string, object> inputAttrs, string tagName, InputOptions inputOptions)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.Dictionary<System.String,System.Object>inputAttrs
System.StringtagName
ServiceStack.InputOptionsinputOptions

BundleJs(HtmlHelper, BundleOptions)

View Source
Declaration
public static HtmlString BundleJs(this HtmlHelper html, BundleOptions options)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
ServiceStack.BundleOptionsoptions

BundleCss(HtmlHelper, BundleOptions)

View Source
Declaration
public static HtmlString BundleCss(this HtmlHelper html, BundleOptions options)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
ServiceStack.BundleOptionsoptions

BundleHtml(HtmlHelper, BundleOptions)

View Source
Declaration
public static HtmlString BundleHtml(this HtmlHelper html, BundleOptions options)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
ServiceStack.BundleOptionsoptions

TextDump(HtmlHelper, Object)

View Source
Declaration
public static string TextDump(this HtmlHelper html, object target)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Objecttarget

TextDump(HtmlHelper, Object, TextDumpOptions)

View Source
Declaration
public static string TextDump(this HtmlHelper html, object target, TextDumpOptions options)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Objecttarget
ServiceStack.TextDumpOptionsoptions

HtmlDump(HtmlHelper, Object)

View Source
Declaration
public static HtmlString HtmlDump(this HtmlHelper html, object target)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Objecttarget

HtmlDump(HtmlHelper, Object, HtmlDumpOptions)

View Source
Declaration
public static HtmlString HtmlDump(this HtmlHelper html, object target, HtmlDumpOptions options)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Objecttarget
ServiceStack.HtmlDumpOptionsoptions

GetNavItems(HtmlHelper)

View Source
Declaration
public static List<NavItem> GetNavItems(this HtmlHelper html)
Returns

System.Collections.Generic.List<NavItem>

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml

GetNavItems(HtmlHelper, String)

View Source
Declaration
public static List<NavItem> GetNavItems(this HtmlHelper html, string key)
Returns

System.Collections.Generic.List<NavItem>

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringkey

Nav(HtmlHelper)

View Source
Declaration
public static HtmlString Nav(this HtmlHelper html)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml

Nav(HtmlHelper, NavOptions)

View Source
Declaration
public static HtmlString Nav(this HtmlHelper html, NavOptions options)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
ServiceStack.NavOptionsoptions

Nav(HtmlHelper, List<NavItem>)

View Source
Declaration
public static HtmlString Nav(this HtmlHelper html, List<NavItem> navItems)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.List<NavItem>navItems

Nav(HtmlHelper, List<NavItem>, NavOptions)

View Source
Declaration
public static HtmlString Nav(this HtmlHelper html, List<NavItem> navItems, NavOptions options)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.List<NavItem>navItems
ServiceStack.NavOptionsoptions

Navbar(HtmlHelper)

View Source
Declaration
public static HtmlString Navbar(this HtmlHelper html)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml

Navbar(HtmlHelper, NavOptions)

View Source
Declaration
public static HtmlString Navbar(this HtmlHelper html, NavOptions options)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
ServiceStack.NavOptionsoptions

Navbar(HtmlHelper, List<NavItem>)

View Source
Declaration
public static HtmlString Navbar(this HtmlHelper html, List<NavItem> navItems)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.List<NavItem>navItems

Navbar(HtmlHelper, List<NavItem>, NavOptions)

View Source
Declaration
public static HtmlString Navbar(this HtmlHelper html, List<NavItem> navItems, NavOptions options)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.List<NavItem>navItems
ServiceStack.NavOptionsoptions

NavLink(HtmlHelper, NavItem)

View Source
Declaration
public static HtmlString NavLink(this HtmlHelper html, NavItem navItem)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
NavItemnavItem

NavLink(HtmlHelper, NavItem, NavOptions)

View Source
Declaration
public static HtmlString NavLink(this HtmlHelper html, NavItem navItem, NavOptions options)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
NavItemnavItem
ServiceStack.NavOptionsoptions

NavButtonGroup(HtmlHelper)

View Source
Declaration
public static HtmlString NavButtonGroup(this HtmlHelper html)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml

NavButtonGroup(HtmlHelper, NavOptions)

View Source
Declaration
public static HtmlString NavButtonGroup(this HtmlHelper html, NavOptions options)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
ServiceStack.NavOptionsoptions

NavButtonGroup(HtmlHelper, List<NavItem>)

View Source
Declaration
public static HtmlString NavButtonGroup(this HtmlHelper html, List<NavItem> navItems)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.List<NavItem>navItems

NavButtonGroup(HtmlHelper, List<NavItem>, NavOptions)

View Source
Declaration
public static HtmlString NavButtonGroup(this HtmlHelper html, List<NavItem> navItems, NavOptions options)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Collections.Generic.List<NavItem>navItems
ServiceStack.NavOptionsoptions

CssIncludes(HtmlHelper, String[])

View Source
Declaration
public static HtmlString CssIncludes(this HtmlHelper html, params string[] cssFiles)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.String[]cssFiles

JsIncludes(HtmlHelper, String[])

View Source
Declaration
public static HtmlString JsIncludes(this HtmlHelper html, params string[] jsFiles)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.String[]jsFiles

SvgImage(HtmlHelper, String)

View Source
Declaration
public static HtmlString SvgImage(this HtmlHelper html, string name)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname

SvgImage(HtmlHelper, String, String)

View Source
Declaration
public static HtmlString SvgImage(this HtmlHelper html, string name, string fillColor)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname
System.StringfillColor

SvgDataUri(HtmlHelper, String)

View Source
Declaration
public static HtmlString SvgDataUri(this HtmlHelper html, string name)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname

SvgDataUri(HtmlHelper, String, String)

View Source
Declaration
public static HtmlString SvgDataUri(this HtmlHelper html, string name, string fillColor)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname
System.StringfillColor

SvgBackgroundImageCss(HtmlHelper, String)

View Source
Declaration
public static HtmlString SvgBackgroundImageCss(this HtmlHelper html, string name)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname

SvgBackgroundImageCss(HtmlHelper, String, String)

View Source
Declaration
public static HtmlString SvgBackgroundImageCss(this HtmlHelper html, string name, string fillColor)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringname
System.StringfillColor

SvgInBackgroundImageCss(HtmlHelper, String)

View Source
Declaration
public static HtmlString SvgInBackgroundImageCss(this HtmlHelper html, string svg)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringsvg

SvgFill(HtmlHelper, String, String)

View Source
Declaration
public static HtmlString SvgFill(this HtmlHelper html, string svg, string color)
Returns

System.Web.HtmlString

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml
System.Stringsvg
System.Stringcolor

SvgBaseUrl(HtmlHelper)

View Source
Declaration
public static string SvgBaseUrl(this HtmlHelper html)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.HtmlHelperhtml