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:
Return type:

System.String

Returns:

A System.String containing the formatted value.

public static string Value(this IHtmlHelper htmlHelper, string expression)
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:
Return type:

System.String

Returns:

A System.String containing the formatted value.

public static string ValueForModel(this IHtmlHelper htmlHelper, string format)
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:
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)