ModelMetadata Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a container for metadata for a model.
public ref class ModelMetadata
public class ModelMetadata
type ModelMetadata = class
Public Class ModelMetadata
- Inheritance
-
ModelMetadata
- Derived
The word model is used differently in the context of this class than it is typically used elsewhere. In an ASP.NET Web Forms application, the ModelType attribute of a data-bound control specifies the type of a data element that the data control is bound to. This type is typically referred to as the model, and it typically corresponds to a row in a database table. The properties of the model typically correspond to columns of the table.
A ModelMetadata object can provide metadata for the model itself or for a property of the model, or for a property of a complex property. When the ModelMetadata object pertains to a property, the word model refers to the property, and the word container refers to the model.
For example, the model might be Contact, which has Name and Age properties, and the Name property might be a complex property composed of FirstName and LastName. When the ModelMetadata object pertains to the Contact object, the model type is Contact and there is no container. When the ModelMetadata object pertains to the Name property, the model type is Name and the container type is Contact. When the ModelMetadata object pertains to the FirstName property, the model type is FirstName and the container type is Name.
Model |
Initializes a new instance of the ModelMetadata class. |
Default |
An integer value that is always set to |
Additional |
Gets a collection that contains additional metadata about the model. |
Container |
Gets the type of the container. |
Convert |
Gets or sets a value that determines whether empty strings that are submitted in forms should be converted to |
Data |
Gets or sets the name of the data type. |
Description |
Gets or sets text that describes the model. |
Display |
Gets or sets a format string that should be applied when the model is displayed in display mode (as opposed to in edit mode). |
Display |
Gets or sets the text to use in UI when the name of the model is displayed. |
Edit |
Gets or sets the format string to use in UI in edit mode. |
Hide |
Gets or sets a value that determines whether surrounding HTML should be hidden. |
Is |
Gets a value that specifies whether the model is a complex type. |
Is |
Gets a value that specifies whether the model is a nullable value type. |
Is |
Gets or sets a value that specifies whether the model can be updated. |
Is |
Gets or sets a value that specifies whether the property is required. |
Model |
Gets or sets the model object. |
Model |
Gets the type of the model. |
Null |
Gets the string that should be displayed when the model is |
Order |
Gets or sets an integer that indicates the order in which to display this property relative to other properties. |
Properties |
Gets a collection of model metadata objects that describe the properties of the model. |
Property |
Gets the name of the property. |
Provider |
Gets or sets the provider object for this metadata. |
Request |
Gets or sets a value that specifies whether request validation is enabled. |
Short |
Gets or sets a short version of the display name. |
Show |
Gets or sets a value that specifies whether the model should be displayed in the UI in display mode (as opposed to edit mode). |
Show |
Gets or sets a value that specifies whether the property should be displayed in edit mode (as opposed to display mode). |
Simple |
Gets or sets text to display for the model when the model represents a complex object. |
Template |
Gets or sets a value that indicates what template (data control) should be used in UI for the model. |
Watermark |
Gets or sets watermark text for a text box. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Returns text to display as the name of the model in UI. |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Returns text to display for the model when the model represents a complex object. |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Get |
Returns a collection of validators that apply to the model. |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
To |
Returns a string that represents the current object. (Inherited from Object) |
Product | Versions |
---|---|
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: