ModelMetadata.GetSimpleDisplayText Method ()

.NET Framework (current version)
 

Returns text to display for the model when the model represents a complex object.

Namespace:   System.Web.ModelBinding
Assembly:  System.Web (in System.Web.dll)

abstract GetSimpleDisplayText : unit -> string
override GetSimpleDisplayText : unit -> string

Return Value

Type: System.String

The property value is derived by examining the following sequence of related values until a return value is found.

  1. If the SimpleDisplayText property value is not null, that value is returned.

  2. If the Model property is null, the NullDisplayText property value is returned.

  3. If an attempt to convert the Model property to a string returns null, an empty string is returned.

  4. If the string conversion of the Model property value is the same as the FullName property of the Model property type, that value is returned.

  5. If there are no properties in the Properties collection, an empty string is returned.

  6. If none of the preceding tests have returned a value, the return value comes from the first property in the Properties collection. If the Model property of the first property is null, the NullDisplayText property value is returned; otherwise the result of converting the first property's Model property to a string is returned.

.NET Framework
Available since 4.5
Return to top
Show: