Freigeben über


ModelMetadata.HideSurroundingHtml Property

Gets or sets a value that indicates whether the model object should be rendered using associated HTML elements.

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

Syntax

'Declaration
Public Overridable Property HideSurroundingHtml As Boolean
    Get
    Set
public virtual bool HideSurroundingHtml { get; set; }
public:
virtual property bool HideSurroundingHtml {
    bool get ();
    void set (bool value);
}

Property Value

Type: System.Boolean
true if the associated HTML elements that contains the model object should be included with the object; otherwise, false.

Remarks

When this property is used with the DataAnnotationsModelMetadataProvider model metadata provider, it is set to true when both the HiddenInputAttribute attribute is true and the DisplayValue property is set to false.

When this property is set to false, the EditorFor method renders an HTML div element as a container for the model, and it renders a label element as a caption for the model. When the property is set to true, the div and label elements are not rendered. This property is often used when a template generates a hidden input element.

See Also

Reference

ModelMetadata Class

System.Web.Mvc Namespace