Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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)

public:
property bool HideSurroundingHtml {
	virtual bool get();
	virtual 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.

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.

Return to top
Show:
© 2015 Microsoft