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

public virtual bool HideSurroundingHtml { get; set; }
public:
property bool HideSurroundingHtml {
    virtual bool get();
    virtual void set(bool value);
}
abstract HideSurroundingHtml : bool with get, set
override HideSurroundingHtml : bool with get, set
Public Overridable Property HideSurroundingHtml As Boolean

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<TModel, TValue> 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

ModelMetadata Class
System.Web.Mvc Namespace

Return to top