HtmlHelperValueExtensions Class¶
Summary¶
Value-related extensions for [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) and [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1.yml).
Methods¶
-
Value
(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String)¶ Returns the formatted value for the specified <paramref name=”expression” />.
Arguments: - htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
- expression (System.String) – Expression name, relative to the current model.
Return type: System.String
Returns: A [System.String]() containing the formatted value.
public static string Value(IHtmlHelper htmlHelper, string expression)
-
ValueForModel
(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper)¶ Returns the formatted value for the current model.
Arguments: - htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
Return type: System.String
Returns: A [System.String]() containing the formatted value.
public static string ValueForModel(IHtmlHelper htmlHelper)
-
ValueForModel
(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String) Returns the formatted value for the current model.
Arguments: - htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
- format (System.String) – The composite format [System.String]() (see http://msdn.microsoft.com/en-us/library/txafckwd.aspx).
Return type: System.String
Returns: A [System.String]() containing the formatted value.
public static string ValueForModel(IHtmlHelper htmlHelper, string format)
-
Microsoft.AspNet.Mvc.Rendering.HtmlHelperValueExtensions.ValueFor<TModel, TResult>(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper<TModel>, System.Linq.Expressions.Expression<System.Func<TModel, TResult>>)
Returns the formatted value for the specified <paramref name=”expression” />.
Arguments: - htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper{{TModel}}) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1.yml) instance this method extends.
- expression (System.Linq.Expressions.Expression{System.Func{{TModel},{TResult}}}) – An expression to be evaluated against the current model.
Return type: System.String
Returns: A [System.String]() containing the formatted value.
public static string ValueFor<TModel, TResult>(IHtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TResult>> expression)
-