HtmlHelperValueExtensions Class¶
Value-related extensions for Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
and Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper`1
.
- Namespace
Microsoft.AspNetCore.Mvc.Rendering
- Assemblies
- Microsoft.AspNetCore.Mvc.ViewFeatures
Syntax¶
public class HtmlHelperValueExtensions
-
class
Microsoft.AspNetCore.Mvc.Rendering.
HtmlHelperValueExtensions
Methods¶
-
Value
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String)¶ Returns the formatted value for the specified <em>expression</em>.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
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(this IHtmlHelper htmlHelper, string expression)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
ValueForModel
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper)¶ Returns the formatted value for the current model.
Arguments: htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
instance this method extends.Return type: System.String Returns: A System.String
containing the formatted value.public static string ValueForModel(this IHtmlHelper htmlHelper)
-
ValueForModel
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper, System.String) Returns the formatted value for the current model.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
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(this IHtmlHelper htmlHelper, string format)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The
-
ValueFor<TModel, TResult>
(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>, System.Linq.Expressions.Expression<System.Func<TModel, TResult>>)¶ Returns the formatted value for the specified <em>expression</em>.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper`1
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>(this IHtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TResult>> expression)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>) – The
-