Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
IsRequired Property

ModelMetadata.IsRequired Property

 

Gets or sets a value that indicates whether the model is required.

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

public virtual bool IsRequired { get; set; }

Property Value

Type: System.Boolean

true if the model is required; otherwise, false.

The default value for this property is true for non-nullable value types and false for all other types.

Return to top
Show:
© 2015 Microsoft