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)

function get HideSurroundingHtml () : boolean 
function set HideSurroundingHtml (value : 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.

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.

© 2015 Microsoft