Skip to main content

HtmlHelper

Assembly: ServiceStack.Razor.dll
View Source
Declaration
public class HtmlHelper : IHtmlContext

Properties

HttpRequest

View Source
Declaration
public IHttpRequest HttpRequest { get; set; }

HttpResponse

View Source
Declaration
public IHttpResponse HttpResponse { get; set; }

Writer

View Source
Declaration
public StreamWriter Writer { get; set; }

ViewEngine

View Source
Declaration
public IViewEngine ViewEngine { get; set; }

RazorPage

View Source
Declaration
public IRazorView RazorPage { get; protected set; }

MarkdownPage

View Source
Declaration
public MarkdownPage MarkdownPage { get; protected set; }

ScopeArgs

View Source
Declaration
public Dictionary<string, object> ScopeArgs { get; protected set; }

ClientValidationEnabled

View Source
Declaration
public static bool ClientValidationEnabled { get; set; }

UnobtrusiveJavaScriptEnabled

View Source
Declaration
public static bool UnobtrusiveJavaScriptEnabled { get; set; }

ViewBag

View Source
Declaration
public dynamic ViewBag { get; }

ViewContext

View Source
Declaration
public ViewContext ViewContext { get; }

ViewData

View Source
Declaration
public ViewDataDictionary ViewData { get; protected set; }

ViewDataContainer

View Source
Declaration
public IViewDataContainer ViewDataContainer { get; }

Fields

DefaultTemplate

View Source
Declaration
public const string DefaultTemplate = null

EmptyTemplate

View Source
Declaration
public const string EmptyTemplate = ""

ValidationMessageCssClassNames

View Source
Declaration
public static string ValidationMessageCssClassNames

ValidationSummaryCssClassNames

View Source
Declaration
public static string ValidationSummaryCssClassNames

ValidationSuccessCssClassNames

View Source
Declaration
public static string ValidationSuccessCssClassNames

ValidationInputCssClassName

View Source
Declaration
public static readonly string ValidationInputCssClassName

ValidationInputValidCssClassName

View Source
Declaration
public static readonly string ValidationInputValidCssClassName

ValidationMessageValidCssClassName

View Source
Declaration
public static readonly string ValidationMessageValidCssClassName

ValidationSummaryValidCssClassName

View Source
Declaration
public static readonly string ValidationSummaryValidCssClassName

HtmlExtensions

View Source
Declaration
public static List<Type> HtmlExtensions

Methods

GetMethod(String)

View Source
Declaration
public static MethodInfo GetMethod(string methodName)
Returns

System.Reflection.MethodInfo

Parameters
TypeName
System.StringmethodName

Init(IViewEngine, IRequest, IResponse, IRazorView, Dictionary<String, Object>, ViewDataDictionary)

View Source
Declaration
public void Init(IViewEngine viewEngine, IRequest httpReq, IResponse httpRes, IRazorView razorPage, Dictionary<string, object> scopeArgs = null, ViewDataDictionary viewData = null)
Parameters
TypeName
ServiceStack.Html.IViewEngineviewEngine
IRequesthttpReq
IResponsehttpRes
ServiceStack.Html.IRazorViewrazorPage
System.Collections.Generic.Dictionary<System.String,System.Object>scopeArgs
ServiceStack.Html.ViewDataDictionaryviewData

Init(MarkdownPage, Dictionary<String, Object>, Boolean, ViewDataDictionary, HtmlHelper)

View Source
Declaration
public void Init(MarkdownPage markdownPage, Dictionary<string, object> scopeArgs, bool renderHtml, ViewDataDictionary viewData, HtmlHelper htmlHelper)
Parameters
TypeName
ServiceStack.Support.Markdown.MarkdownPagemarkdownPage
System.Collections.Generic.Dictionary<System.String,System.Object>scopeArgs
System.BooleanrenderHtml
ServiceStack.Html.ViewDataDictionaryviewData
ServiceStack.Html.HtmlHelperhtmlHelper

Init(IHttpRequest, IHttpResponse, IViewEngine, ViewDataDictionary, HtmlHelper)

View Source
Declaration
public void Init(IHttpRequest httpReq, IHttpResponse httpRes, IViewEngine viewEngine, ViewDataDictionary viewData, HtmlHelper htmlHelper)
Parameters
TypeName
IHttpRequesthttpReq
IHttpResponsehttpRes
ServiceStack.Html.IViewEngineviewEngine
ServiceStack.Html.ViewDataDictionaryviewData
ServiceStack.Html.HtmlHelperhtmlHelper

Partial(String)

View Source
Declaration
public MvcHtmlString Partial(string viewName)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
System.StringviewName

Partial(String, Object)

View Source
Declaration
public MvcHtmlString Partial(string viewName, object model)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
System.StringviewName
System.Objectmodel

RenderAction(String, String)

View Source
Declaration
public MvcHtmlString RenderAction(string route, string viewName = null)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
System.Stringroute
System.StringviewName

Debug(Object)

View Source
Declaration
public string Debug(object model)
Returns

System.String

Parameters
TypeName
System.Objectmodel

SetModel(Object)

View Source
Declaration
public void SetModel(object model)
Parameters
TypeName
System.Objectmodel

AnonymousObjectToHtmlAttributes(Object)

View Source
Declaration
public static RouteValueDictionary AnonymousObjectToHtmlAttributes(object htmlAttributes)
Returns

ServiceStack.Html.RouteValueDictionary

Parameters
TypeName
System.ObjecthtmlAttributes

AntiForgeryToken()

View Source
Declaration
public MvcHtmlString AntiForgeryToken()
Returns

ServiceStack.Html.MvcHtmlString

AntiForgeryToken(String)

View Source
Declaration
public MvcHtmlString AntiForgeryToken(string salt)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
System.Stringsalt

AntiForgeryToken(String, String, String)

View Source
Declaration
public MvcHtmlString AntiForgeryToken(string salt, string domain, string path)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
System.Stringsalt
System.Stringdomain
System.Stringpath

AttributeEncode(String)

View Source
Declaration
public string AttributeEncode(string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

AttributeEncode(Object)

View Source
Declaration
public string AttributeEncode(object value)
Returns

System.String

Parameters
TypeName
System.Objectvalue

EnableClientValidation()

View Source
Declaration
public void EnableClientValidation()

EnableClientValidation(Boolean)

View Source
Declaration
public void EnableClientValidation(bool enabled)
Parameters
TypeName
System.Booleanenabled

EnableUnobtrusiveJavaScript()

View Source
Declaration
public void EnableUnobtrusiveJavaScript()

EnableUnobtrusiveJavaScript(Boolean)

View Source
Declaration
public void EnableUnobtrusiveJavaScript(bool enabled)
Parameters
TypeName
System.Booleanenabled

Encode(String)

View Source
Declaration
public string Encode(string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

Encode(Object)

View Source
Declaration
public string Encode(object value)
Returns

System.String

Parameters
TypeName
System.Objectvalue

FormatValue(Object, String)

View Source
Declaration
public string FormatValue(object value, string format)
Returns

System.String

Parameters
TypeName
System.Objectvalue
System.Stringformat

GenerateIdFromName(String)

View Source
Declaration
public static string GenerateIdFromName(string name)
Returns

System.String

Parameters
TypeName
System.Stringname

GenerateIdFromName(String, String)

View Source
Declaration
public static string GenerateIdFromName(string name, string idAttributeDotReplacement)
Returns

System.String

Parameters
TypeName
System.Stringname
System.StringidAttributeDotReplacement

GetFormMethodString(FormMethod)

View Source
Declaration
public static string GetFormMethodString(FormMethod method)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.FormMethodmethod

GetInputTypeString(InputType)

View Source
Declaration
public static string GetInputTypeString(InputType inputType)
Returns

System.String

Parameters
TypeName
ServiceStack.Html.InputTypeinputType

GetUnobtrusiveValidationAttributes(String)

View Source
Declaration
public IDictionary<string, object> GetUnobtrusiveValidationAttributes(string name)
Returns

System.Collections.Generic.IDictionary<System.String,System.Object>

Parameters
TypeName
System.Stringname

GetUnobtrusiveValidationAttributes(String, ModelMetadata)

View Source
Declaration
public IDictionary<string, object> GetUnobtrusiveValidationAttributes(string name, ModelMetadata metadata)
Returns

System.Collections.Generic.IDictionary<System.String,System.Object>

Parameters
TypeName
System.Stringname
ServiceStack.Html.ModelMetadatametadata

HttpMethodOverride(HttpVerbs)

View Source
Declaration
public MvcHtmlString HttpMethodOverride(HttpVerbs httpVerb)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
ServiceStack.Html.HttpVerbshttpVerb

HttpMethodOverride(String)

View Source
Declaration
public MvcHtmlString HttpMethodOverride(string httpMethod)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
System.StringhttpMethod

Raw(Object)

View Source
Declaration
public MvcHtmlString Raw(object content)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
System.Objectcontent

HasFieldError(String)

View Source
Declaration
public bool HasFieldError(string errorName)
Returns

System.Boolean

Parameters
TypeName
System.StringerrorName

GetFieldError(String)

View Source
Declaration
public ResponseError GetFieldError(string errorName)
Returns

ResponseError

Parameters
TypeName
System.StringerrorName

GetErrorStatus()

View Source
Declaration
public ResponseStatus GetErrorStatus()
Returns

ResponseStatus

GetErrorMessage()

View Source
Declaration
public MvcHtmlString GetErrorMessage()
Returns

ServiceStack.Html.MvcHtmlString

RenderMarkdownToHtml(String)

View Source
Declaration
public MvcHtmlString RenderMarkdownToHtml(string markdown)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
System.Stringmarkdown

IncludeFile(String)

View Source
Declaration
public MvcHtmlString IncludeFile(string virtualPath)
Returns

ServiceStack.Html.MvcHtmlString

Parameters
TypeName
System.StringvirtualPath

Implements