HtmlHelper.Value(String, String) Method

Definition

Returns the formatted value for the specified expression. Specifically, returns the first non-null value found in: the ModelState entry with full name, the ViewData entry with full name, or the expression evaluated against Model. See Name(String) for more information about a "full name".

public:
 virtual System::String ^ Value(System::String ^ expression, System::String ^ format);
public string Value (string expression, string format);
abstract member Value : string * string -> string
override this.Value : string * string -> string
Public Function Value (expression As String, format As String) As String

Parameters

expression
String

Expression name, relative to the current model.

format
String

The format string (see https://msdn.microsoft.com/en-us/library/txafckwd.aspx) used to format the return value unless that came from model binding.

Returns

A String containing the formatted value.

Implements

Applies to