HtmlHelper Class¶
Summary¶
Default implementation of [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml).
Fields¶
-
ValidationInputCssClassName
()¶ public static readonly string ValidationInputCssClassName
-
ValidationInputValidCssClassName
()¶ public static readonly string ValidationInputValidCssClassName
-
ValidationMessageCssClassName
()¶ public static readonly string ValidationMessageCssClassName
-
ValidationMessageValidCssClassName
()¶ public static readonly string ValidationMessageValidCssClassName
-
ValidationSummaryCssClassName
()¶ public static readonly string ValidationSummaryCssClassName
-
ValidationSummaryValidCssClassName
()¶ public static readonly string ValidationSummaryValidCssClassName
-
Constructors¶
-
HtmlHelper
(Microsoft.AspNet.Mvc.Rendering.IHtmlGenerator, Microsoft.AspNet.Mvc.Rendering.ICompositeViewEngine, Microsoft.AspNet.Mvc.ModelBinding.IModelMetadataProvider, IHtmlEncoder, IUrlEncoder, IJavaScriptStringEncoder)¶ Initializes a new instance of the [Microsoft.AspNet.Mvc.Rendering.HtmlHelper](Microsoft.AspNet.Mvc.Rendering.HtmlHelper.yml) class.
Arguments: - htmlGenerator (Microsoft.AspNet.Mvc.Rendering.IHtmlGenerator) –
- viewEngine (Microsoft.AspNet.Mvc.Rendering.ICompositeViewEngine) –
- metadataProvider (Microsoft.AspNet.Mvc.ModelBinding.IModelMetadataProvider) –
- htmlEncoder (IHtmlEncoder) –
- urlEncoder (IUrlEncoder) –
- javaScriptStringEncoder (IJavaScriptStringEncoder) –
public HtmlHelper(IHtmlGenerator htmlGenerator, ICompositeViewEngine viewEngine, IModelMetadataProvider metadataProvider, IHtmlEncoder htmlEncoder, IUrlEncoder urlEncoder, IJavaScriptStringEncoder javaScriptStringEncoder)
-
Properties¶
-
Html5DateRenderingMode
()¶ Return type: Microsoft.AspNet.Mvc.Rendering.Html5DateRenderingMode public Html5DateRenderingMode Html5DateRenderingMode { get; set; }
-
HtmlEncoder
()¶ Return type: IHtmlEncoder public IHtmlEncoder HtmlEncoder { get; }
-
IdAttributeDotReplacement
()¶ Return type: System.String public string IdAttributeDotReplacement { get; }
-
JavaScriptStringEncoder
()¶ Return type: IJavaScriptStringEncoder public IJavaScriptStringEncoder JavaScriptStringEncoder { get; }
-
MetadataProvider
()¶ Return type: Microsoft.AspNet.Mvc.ModelBinding.IModelMetadataProvider public IModelMetadataProvider MetadataProvider { get; }
-
TempData
()¶ Return type: Microsoft.AspNet.Mvc.ITempDataDictionary public ITempDataDictionary TempData { get; }
-
UrlEncoder
()¶ Return type: IUrlEncoder public IUrlEncoder UrlEncoder { get; }
-
ViewBag
()¶ Return type: dynamic public ViewBag { get; }
-
ViewContext
()¶ Return type: Microsoft.AspNet.Mvc.ViewContext public ViewContext ViewContext { get; }
-
ViewData
()¶ Return type: Microsoft.AspNet.Mvc.ViewDataDictionary public ViewDataDictionary ViewData { get; }
-
Methods¶
-
ActionLink
(System.String, System.String, System.String, System.String, System.String, System.String, System.Object, System.Object)¶ Arguments: - linkText (System.String) –
- actionName (System.String) –
- controllerName (System.String) –
- protocol (System.String) –
- hostname (System.String) –
- fragment (System.String) –
- routeValues (System.Object) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString ActionLink(string linkText, string actionName, string controllerName, string protocol, string hostname, string fragment, object routeValues, object htmlAttributes)
-
AnonymousObjectToHtmlAttributes
(System.Object)¶ Creates a dictionary of HTML attributes from the input object, translating underscores to dashes in each public instance property.
If the object is already an [System.Collections.Generic.IDictionary`2]() instance, then it is returned as-is.
<example> <c>new { data_name=”value” }</c> will translate to the entry <c>{ “data-name”, “value” }</c> in the resulting dictionary. </example>
Arguments: - htmlAttributes (System.Object) – Anonymous object describing HTML attributes.
Return type: System.Collections.Generic.IDictionary{System.String,System.Object}
Returns: A dictionary that represents HTML attributes.
public static IDictionary<string, object> AnonymousObjectToHtmlAttributes(object htmlAttributes)
-
Microsoft.AspNet.Mvc.Rendering.HtmlHelper.AntiForgeryToken()
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString public HtmlString AntiForgeryToken()
-
BeginForm
(System.String, System.String, System.Object, Microsoft.AspNet.Mvc.Rendering.FormMethod, System.Object)¶ Arguments: - actionName (System.String) –
- controllerName (System.String) –
- routeValues (System.Object) –
- method (Microsoft.AspNet.Mvc.Rendering.FormMethod) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.MvcForm
public MvcForm BeginForm(string actionName, string controllerName, object routeValues, FormMethod method, object htmlAttributes)
-
BeginRouteForm
(System.String, System.Object, Microsoft.AspNet.Mvc.Rendering.FormMethod, System.Object)¶ Arguments: - routeName (System.String) –
- routeValues (System.Object) –
- method (Microsoft.AspNet.Mvc.Rendering.FormMethod) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.MvcForm
public MvcForm BeginRouteForm(string routeName, object routeValues, FormMethod method, object htmlAttributes)
-
CheckBox
(System.String, System.Nullable<System.Boolean>, System.Object)¶ Arguments: - expression (System.String) –
- isChecked (System.Nullable{System.Boolean}) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString CheckBox(string expression, bool ? isChecked, object htmlAttributes)
-
Contextualize
(Microsoft.AspNet.Mvc.ViewContext)¶ Arguments: - viewContext (Microsoft.AspNet.Mvc.ViewContext) –
public virtual void Contextualize(ViewContext viewContext)
-
Microsoft.AspNet.Mvc.Rendering.HtmlHelper.CreateForm()
Override this method to return an [Microsoft.AspNet.Mvc.Rendering.MvcForm](Microsoft.AspNet.Mvc.Rendering.MvcForm.yml) subclass. That subclass may change [Microsoft.AspNet.Mvc.Rendering.HtmlHelper.EndForm](Microsoft.AspNet.Mvc.Rendering.HtmlHelper.yml) behavior.
Return type: Microsoft.AspNet.Mvc.Rendering.MvcForm Returns: A new [Microsoft.AspNet.Mvc.Rendering.MvcForm](Microsoft.AspNet.Mvc.Rendering.MvcForm.yml) instance. protected virtual MvcForm CreateForm()
-
Display
(System.String, System.String, System.String, System.Object)¶ Arguments: - expression (System.String) –
- templateName (System.String) –
- htmlFieldName (System.String) –
- additionalViewData (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString Display(string expression, string templateName, string htmlFieldName, object additionalViewData)
-
DisplayName
(System.String)¶ Arguments: - expression (System.String) –
Return type: System.String
public string DisplayName(string expression)
-
DisplayText
(System.String)¶ Arguments: - expression (System.String) –
Return type: System.String
public string DisplayText(string expression)
-
DropDownList
(System.String, System.Collections.Generic.IEnumerable<Microsoft.AspNet.Mvc.Rendering.SelectListItem>, System.String, System.Object)¶ Arguments: - expression (System.String) –
- selectList (System.Collections.Generic.IEnumerable{Microsoft.AspNet.Mvc.Rendering.SelectListItem}) –
- optionLabel (System.String) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString DropDownList(string expression, IEnumerable<SelectListItem> selectList, string optionLabel, object htmlAttributes)
-
Editor
(System.String, System.String, System.String, System.Object)¶ Arguments: - expression (System.String) –
- templateName (System.String) –
- htmlFieldName (System.String) –
- additionalViewData (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString Editor(string expression, string templateName, string htmlFieldName, object additionalViewData)
-
Encode
(System.Object)¶ Arguments: - value (System.Object) –
Return type: System.String
public string Encode(object value)
-
Encode
(System.String) Arguments: - value (System.String) –
Return type: System.String
public string Encode(string value)
-
Microsoft.AspNet.Mvc.Rendering.HtmlHelper.EndForm()
public void EndForm()
-
FormatValue
(System.Object, System.String)¶ Arguments: - value (System.Object) –
- format (System.String) –
Return type: System.String
public string FormatValue(object value, string format)
-
GenerateCheckBox
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, System.String, System.Nullable<System.Boolean>, System.Object)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
- expression (System.String) –
- isChecked (System.Nullable{System.Boolean}) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
protected virtual HtmlString GenerateCheckBox(ModelExplorer modelExplorer, string expression, bool ? isChecked, object htmlAttributes)
-
GenerateDisplay
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, System.String, System.String, System.Object)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
- htmlFieldName (System.String) –
- templateName (System.String) –
- additionalViewData (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
protected virtual HtmlString GenerateDisplay(ModelExplorer modelExplorer, string htmlFieldName, string templateName, object additionalViewData)
-
GenerateDisplayName
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, System.String)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
- expression (System.String) –
Return type: System.String
protected virtual string GenerateDisplayName(ModelExplorer modelExplorer, string expression)
-
GenerateDisplayText
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
Return type: System.String
protected virtual string GenerateDisplayText(ModelExplorer modelExplorer)
-
GenerateDropDown
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, System.String, System.Collections.Generic.IEnumerable<Microsoft.AspNet.Mvc.Rendering.SelectListItem>, System.String, System.Object)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
- expression (System.String) –
- selectList (System.Collections.Generic.IEnumerable{Microsoft.AspNet.Mvc.Rendering.SelectListItem}) –
- optionLabel (System.String) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
protected HtmlString GenerateDropDown(ModelExplorer modelExplorer, string expression, IEnumerable<SelectListItem> selectList, string optionLabel, object htmlAttributes)
-
GenerateEditor
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, System.String, System.String, System.Object)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
- htmlFieldName (System.String) –
- templateName (System.String) –
- additionalViewData (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
protected virtual HtmlString GenerateEditor(ModelExplorer modelExplorer, string htmlFieldName, string templateName, object additionalViewData)
-
GenerateForm
(System.String, System.String, System.Object, Microsoft.AspNet.Mvc.Rendering.FormMethod, System.Object)¶ Renders a <form> start tag to the response. When the user submits the form, the action with name
<paramref name=”actionName” /> will process the request.
Arguments: - actionName (System.String) – The name of the action method.
- controllerName (System.String) – The name of the controller.
- routeValues (System.Object) – An [System.Object]() that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the [System.Object](). This [System.Object]() is typically created using [System.Object]() initializer syntax. Alternatively, an [System.Collections.Generic.IDictionary`2]() instance containing the route parameters.
- method (Microsoft.AspNet.Mvc.Rendering.FormMethod) – The HTTP method for processing the form, either GET or POST.
- htmlAttributes (System.Object) – An [System.Object]() that contains the HTML attributes for the element. Alternatively, an [System.Collections.Generic.IDictionary`2]() instance containing the HTML attributes.
Return type: Microsoft.AspNet.Mvc.Rendering.MvcForm
Returns: An [Microsoft.AspNet.Mvc.Rendering.MvcForm](Microsoft.AspNet.Mvc.Rendering.MvcForm.yml) instance which renders the </form> end tag when disposed.
protected virtual MvcForm GenerateForm(string actionName, string controllerName, object routeValues, FormMethod method, object htmlAttributes)
-
GenerateHidden
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, System.String, System.Object, System.Boolean, System.Object)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
- expression (System.String) –
- value (System.Object) –
- useViewData (System.Boolean) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
protected virtual HtmlString GenerateHidden(ModelExplorer modelExplorer, string expression, object value, bool useViewData, object htmlAttributes)
-
GenerateId
(System.String)¶ Arguments: - expression (System.String) –
Return type: System.String
protected virtual string GenerateId(string expression)
-
GenerateIdFromName
(System.String)¶ Arguments: - fullName (System.String) –
Return type: System.String
public string GenerateIdFromName(string fullName)
-
GenerateLabel
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, System.String, System.String, System.Object)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
- expression (System.String) –
- labelText (System.String) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
protected virtual HtmlString GenerateLabel(ModelExplorer modelExplorer, string expression, string labelText, object htmlAttributes)
-
GenerateListBox
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, System.String, System.Collections.Generic.IEnumerable<Microsoft.AspNet.Mvc.Rendering.SelectListItem>, System.Object)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
- expression (System.String) –
- selectList (System.Collections.Generic.IEnumerable{Microsoft.AspNet.Mvc.Rendering.SelectListItem}) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
protected HtmlString GenerateListBox(ModelExplorer modelExplorer, string expression, IEnumerable<SelectListItem> selectList, object htmlAttributes)
-
GenerateName
(System.String)¶ Arguments: - expression (System.String) –
Return type: System.String
protected virtual string GenerateName(string expression)
-
GeneratePassword
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, System.String, System.Object, System.Object)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
- expression (System.String) –
- value (System.Object) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
protected virtual HtmlString GeneratePassword(ModelExplorer modelExplorer, string expression, object value, object htmlAttributes)
-
GenerateRadioButton
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, System.String, System.Object, System.Nullable<System.Boolean>, System.Object)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
- expression (System.String) –
- value (System.Object) –
- isChecked (System.Nullable{System.Boolean}) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
protected virtual HtmlString GenerateRadioButton(ModelExplorer modelExplorer, string expression, object value, bool ? isChecked, object htmlAttributes)
-
GenerateRouteForm
(System.String, System.Object, Microsoft.AspNet.Mvc.Rendering.FormMethod, System.Object)¶ Renders a <form> start tag to the response. The route with name <paramref name=”routeName” /> generates the <form>’s <c>action</c> attribute value.
Arguments: - routeName (System.String) – The name of the route.
- routeValues (System.Object) – An [System.Object]() that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the [System.Object](). This [System.Object]() is typically created using [System.Object]() initializer syntax. Alternatively, an [System.Collections.Generic.IDictionary`2]() instance containing the route parameters.
- method (Microsoft.AspNet.Mvc.Rendering.FormMethod) – The HTTP method for processing the form, either GET or POST.
- htmlAttributes (System.Object) – An [System.Object]() that contains the HTML attributes for the element. Alternatively, an [System.Collections.Generic.IDictionary`2]() instance containing the HTML attributes.
Return type: Microsoft.AspNet.Mvc.Rendering.MvcForm
Returns: An [Microsoft.AspNet.Mvc.Rendering.MvcForm](Microsoft.AspNet.Mvc.Rendering.MvcForm.yml) instance which renders the </form> end tag when disposed.
protected virtual MvcForm GenerateRouteForm(string routeName, object routeValues, FormMethod method, object htmlAttributes)
-
GenerateTextArea
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, System.String, System.Int32, System.Int32, System.Object)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
- expression (System.String) –
- rows (System.Int32) –
- columns (System.Int32) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
protected virtual HtmlString GenerateTextArea(ModelExplorer modelExplorer, string expression, int rows, int columns, object htmlAttributes)
-
GenerateTextBox
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, System.String, System.Object, System.String, System.Object)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
- expression (System.String) –
- value (System.Object) –
- format (System.String) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
protected virtual HtmlString GenerateTextBox(ModelExplorer modelExplorer, string expression, object value, string format, object htmlAttributes)
-
GenerateValidationMessage
(System.String, System.String, System.Object, System.String)¶ Arguments: - expression (System.String) –
- message (System.String) –
- htmlAttributes (System.Object) –
- tag (System.String) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
protected virtual HtmlString GenerateValidationMessage(string expression, string message, object htmlAttributes, string tag)
-
GenerateValidationSummary
(System.Boolean, System.String, System.Object, System.String)¶ Arguments: - excludePropertyErrors (System.Boolean) –
- message (System.String) –
- htmlAttributes (System.Object) –
- tag (System.String) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
protected virtual HtmlString GenerateValidationSummary(bool excludePropertyErrors, string message, object htmlAttributes, string tag)
-
GenerateValue
(System.String, System.Object, System.String, System.Boolean)¶ Arguments: - expression (System.String) –
- value (System.Object) –
- format (System.String) –
- useViewData (System.Boolean) –
Return type: System.String
protected virtual string GenerateValue(string expression, object value, string format, bool useViewData)
-
GetClientValidationRules
(Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, System.String)¶ Arguments: - modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) –
- expression (System.String) –
Return type: System.Collections.Generic.IEnumerable{Microsoft.AspNet.Mvc.ModelBinding.Validation.ModelClientValidationRule}
public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelExplorer modelExplorer, string expression)
-
GetEnumSelectList
(Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata)¶ Returns a select list for the given <paramref name=”metadata” />.
Arguments: - metadata (Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata) – [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]() to generate a select list for.
Return type: System.Collections.Generic.IEnumerable{Microsoft.AspNet.Mvc.Rendering.SelectListItem}
Returns: An [System.Collections.Generic.IEnumerable`1]() containing the select list for the given <paramref name=”metadata” />.
protected virtual IEnumerable<SelectListItem> GetEnumSelectList(ModelMetadata metadata)
-
GetEnumSelectList
(System.Type) Arguments: - enumType (System.Type) –
Return type: System.Collections.Generic.IEnumerable{Microsoft.AspNet.Mvc.Rendering.SelectListItem}
public IEnumerable<SelectListItem> GetEnumSelectList(Type enumType)
-
Microsoft.AspNet.Mvc.Rendering.HtmlHelper.GetEnumSelectList<TEnum>()
Return type: System.Collections.Generic.IEnumerable{Microsoft.AspNet.Mvc.Rendering.SelectListItem} public IEnumerable<SelectListItem> GetEnumSelectList<TEnum>()where TEnum : struct
-
GetFormMethodString
(Microsoft.AspNet.Mvc.Rendering.FormMethod)¶ Returns the HTTP method that handles form input (GET or POST) as a string.
Arguments: - method (Microsoft.AspNet.Mvc.Rendering.FormMethod) – The HTTP method that handles the form.
Return type: System.String
Returns: The form method string, either “get” or “post”.
public static string GetFormMethodString(FormMethod method)
-
Hidden
(System.String, System.Object, System.Object)¶ Arguments: - expression (System.String) –
- value (System.Object) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString Hidden(string expression, object value, object htmlAttributes)
-
Id
(System.String)¶ Arguments: - expression (System.String) –
Return type: System.String
public string Id(string expression)
-
Label
(System.String, System.String, System.Object)¶ Arguments: - expression (System.String) –
- labelText (System.String) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString Label(string expression, string labelText, object htmlAttributes)
-
ListBox
(System.String, System.Collections.Generic.IEnumerable<Microsoft.AspNet.Mvc.Rendering.SelectListItem>, System.Object)¶ Arguments: - expression (System.String) –
- selectList (System.Collections.Generic.IEnumerable{Microsoft.AspNet.Mvc.Rendering.SelectListItem}) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString ListBox(string expression, IEnumerable<SelectListItem> selectList, object htmlAttributes)
-
Name
(System.String)¶ Arguments: - expression (System.String) –
Return type: System.String
public string Name(string expression)
-
ObjectToDictionary
(System.Object)¶ Creates a dictionary from an object, by adding each public instance property as a key with its associated value to the dictionary. It will expose public properties from derived types as well. This is typically used with objects of an anonymous type.
If the <paramref name=”value” /> is already an [System.Collections.Generic.IDictionary`2]() instance, then it is returned as-is.
<example> <c>new { data_name=”value” }</c> will translate to the entry <c>{ “data_name”, “value” }</c> in the resulting dictionary. </example>
Arguments: - value (System.Object) – The [System.Object]() to be converted.
Return type: System.Collections.Generic.IDictionary{System.String,System.Object}
Returns: The created dictionary of property names and property values.
public static IDictionary<string, object> ObjectToDictionary(object value)
-
PartialAsync
(System.String, System.Object, Microsoft.AspNet.Mvc.ViewDataDictionary)¶ Arguments: - partialViewName (System.String) –
- model (System.Object) –
- viewData (Microsoft.AspNet.Mvc.ViewDataDictionary) –
Return type: System.Threading.Tasks.Task{Microsoft.AspNet.Mvc.Rendering.HtmlString}
public Task<HtmlString> PartialAsync(string partialViewName, object model, ViewDataDictionary viewData)
-
Password
(System.String, System.Object, System.Object)¶ Arguments: - expression (System.String) –
- value (System.Object) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString Password(string expression, object value, object htmlAttributes)
-
RadioButton
(System.String, System.Object, System.Nullable<System.Boolean>, System.Object)¶ Arguments: - expression (System.String) –
- value (System.Object) –
- isChecked (System.Nullable{System.Boolean}) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString RadioButton(string expression, object value, bool ? isChecked, object htmlAttributes)
-
Raw
(System.Object)¶ Arguments: - value (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString Raw(object value)
-
Raw
(System.String) Arguments: - value (System.String) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString Raw(string value)
-
RenderPartialAsync
(System.String, System.Object, Microsoft.AspNet.Mvc.ViewDataDictionary)¶ Arguments: - partialViewName (System.String) –
- model (System.Object) –
- viewData (Microsoft.AspNet.Mvc.ViewDataDictionary) –
Return type: System.Threading.Tasks.Task
public Task RenderPartialAsync(string partialViewName, object model, ViewDataDictionary viewData)
-
RenderPartialCoreAsync
(System.String, System.Object, Microsoft.AspNet.Mvc.ViewDataDictionary, System.IO.TextWriter)¶ Arguments: - partialViewName (System.String) –
- model (System.Object) –
- viewData (Microsoft.AspNet.Mvc.ViewDataDictionary) –
- writer (System.IO.TextWriter) –
Return type: System.Threading.Tasks.Task
protected virtual Task RenderPartialCoreAsync(string partialViewName, object model, ViewDataDictionary viewData, TextWriter writer)
-
RouteLink
(System.String, System.String, System.String, System.String, System.String, System.Object, System.Object)¶ Arguments: - linkText (System.String) –
- routeName (System.String) –
- protocol (System.String) –
- hostName (System.String) –
- fragment (System.String) –
- routeValues (System.Object) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString RouteLink(string linkText, string routeName, string protocol, string hostName, string fragment, object routeValues, object htmlAttributes)
-
TextArea
(System.String, System.String, System.Int32, System.Int32, System.Object)¶ Arguments: - expression (System.String) –
- value (System.String) –
- rows (System.Int32) –
- columns (System.Int32) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString TextArea(string expression, string value, int rows, int columns, object htmlAttributes)
-
TextBox
(System.String, System.Object, System.String, System.Object)¶ Arguments: - expression (System.String) –
- value (System.Object) –
- format (System.String) –
- htmlAttributes (System.Object) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString TextBox(string expression, object value, string format, object htmlAttributes)
-
ValidationMessage
(System.String, System.String, System.Object, System.String)¶ Arguments: - expression (System.String) –
- message (System.String) –
- htmlAttributes (System.Object) –
- tag (System.String) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString ValidationMessage(string expression, string message, object htmlAttributes, string tag)
-
ValidationSummary
(System.Boolean, System.String, System.Object, System.String)¶ Arguments: - excludePropertyErrors (System.Boolean) –
- message (System.String) –
- htmlAttributes (System.Object) –
- tag (System.String) –
Return type: Microsoft.AspNet.Mvc.Rendering.HtmlString
public HtmlString ValidationSummary(bool excludePropertyErrors, string message, object htmlAttributes, string tag)
-
Value
(System.String, System.String)¶ Arguments: - expression (System.String) –
- format (System.String) –
Return type: System.String
public string Value(string expression, string format)
-