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
Type | Name |
---|---|
System.String | methodName |
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
Type | Name |
---|---|
ServiceStack.Html.IViewEngine | viewEngine |
IRequest | httpReq |
IResponse | httpRes |
ServiceStack.Html.IRazorView | razorPage |
System.Collections.Generic.Dictionary<System.String,System.Object> | scopeArgs |
ServiceStack.Html.ViewDataDictionary | viewData |
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
Type | Name |
---|---|
ServiceStack.Support.Markdown.MarkdownPage | markdownPage |
System.Collections.Generic.Dictionary<System.String,System.Object> | scopeArgs |
System.Boolean | renderHtml |
ServiceStack.Html.ViewDataDictionary | viewData |
ServiceStack.Html.HtmlHelper | htmlHelper |
Init(IHttpRequest, IHttpResponse, IViewEngine, ViewDataDictionary, HtmlHelper)
View Source
Declaration
public void Init(IHttpRequest httpReq, IHttpResponse httpRes, IViewEngine viewEngine, ViewDataDictionary viewData, HtmlHelper htmlHelper)
Parameters
Type | Name |
---|---|
IHttpRequest | httpReq |
IHttpResponse | httpRes |
ServiceStack.Html.IViewEngine | viewEngine |
ServiceStack.Html.ViewDataDictionary | viewData |
ServiceStack.Html.HtmlHelper | htmlHelper |
Partial(String)
View Source
Declaration
public MvcHtmlString Partial(string viewName)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | viewName |
Partial(String, Object)
View Source
Declaration
public MvcHtmlString Partial(string viewName, object model)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | viewName |
System.Object | model |
RenderAction(String, String)
View Source
Declaration
public MvcHtmlString RenderAction(string route, string viewName = null)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | route |
System.String | viewName |
Debug(Object)
View Source
Declaration
public string Debug(object model)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | model |
SetModel(Object)
View Source
Declaration
public void SetModel(object model)
Parameters
Type | Name |
---|---|
System.Object | model |
AnonymousObjectToHtmlAttributes(Object)
View Source
Declaration
public static RouteValueDictionary AnonymousObjectToHtmlAttributes(object htmlAttributes)
Returns
ServiceStack.Html.RouteValueDictionary
Parameters
Type | Name |
---|---|
System.Object | htmlAttributes |
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
Type | Name |
---|---|
System.String | salt |
AntiForgeryToken(String, String, String)
View Source
Declaration
public MvcHtmlString AntiForgeryToken(string salt, string domain, string path)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | salt |
System.String | domain |
System.String | path |
AttributeEncode(String)
View Source
Declaration
public string AttributeEncode(string value)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | value |
AttributeEncode(Object)
View Source
Declaration
public string AttributeEncode(object value)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | value |
EnableClientValidation()
View Source
Declaration
public void EnableClientValidation()
EnableClientValidation(Boolean)
View Source
Declaration
public void EnableClientValidation(bool enabled)
Parameters
Type | Name |
---|---|
System.Boolean | enabled |
EnableUnobtrusiveJavaScript()
View Source
Declaration
public void EnableUnobtrusiveJavaScript()
EnableUnobtrusiveJavaScript(Boolean)
View Source
Declaration
public void EnableUnobtrusiveJavaScript(bool enabled)
Parameters
Type | Name |
---|---|
System.Boolean | enabled |
Encode(String)
View Source
Declaration
public string Encode(string value)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | value |
Encode(Object)
View Source
Declaration
public string Encode(object value)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | value |
FormatValue(Object, String)
View Source
Declaration
public string FormatValue(object value, string format)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | value |
System.String | format |
GenerateIdFromName(String)
View Source
Declaration
public static string GenerateIdFromName(string name)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | name |
GenerateIdFromName(String, String)
View Source
Declaration
public static string GenerateIdFromName(string name, string idAttributeDotReplacement)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | name |
System.String | idAttributeDotReplacement |
GetFormMethodString(FormMethod)
View Source
Declaration
public static string GetFormMethodString(FormMethod method)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Html.FormMethod | method |
GetInputTypeString(InputType)
View Source
Declaration
public static string GetInputTypeString(InputType inputType)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Html.InputType | inputType |
GetUnobtrusiveValidationAttributes(String)
View Source
Declaration
public IDictionary<string, object> GetUnobtrusiveValidationAttributes(string name)
Returns
System.Collections.Generic.IDictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
System.String | name |
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
Type | Name |
---|---|
System.String | name |
ServiceStack.Html.ModelMetadata | metadata |
HttpMethodOverride(HttpVerbs)
View Source
Declaration
public MvcHtmlString HttpMethodOverride(HttpVerbs httpVerb)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
ServiceStack.Html.HttpVerbs | httpVerb |
HttpMethodOverride(String)
View Source
Declaration
public MvcHtmlString HttpMethodOverride(string httpMethod)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | httpMethod |
Raw(Object)
View Source
Declaration
public MvcHtmlString Raw(object content)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.Object | content |
HasFieldError(String)
View Source
Declaration
public bool HasFieldError(string errorName)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | errorName |
GetFieldError(String)
View Source
Declaration
public ResponseError GetFieldError(string errorName)
Returns
ResponseError
Parameters
Type | Name |
---|---|
System.String | errorName |
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
Type | Name |
---|---|
System.String | markdown |
IncludeFile(String)
View Source
Declaration
public MvcHtmlString IncludeFile(string virtualPath)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | virtualPath |