Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy doesnt <ScaffoldColumn(False)> work?
    text
    copied!<p>Its my understanding that by adding the <strong>ScaffoldColumn(false)</strong> annotation to an property in a class, that property will not added to the view when doing Add View. However even though i have added <strong>scaffoldcolumn false</strong> to properties i dont want added to a Create form, they are still rendered inthe create view. Is <strong>ScaffoldColumn</strong> broken? On page 552 in Pro ASP.NET MVC 3 Framework by Freeman and Sanderson, it states </p> <blockquote> <p>"If we want to exclude a property from the generated HTML, we can use ScaffoldColumn attribute. When the scaffolding helpers see the ScaffoldColumn attribute, they skip over the property entirely; no hidden input elements will be generated and no details of this property will be included in the generated HTML."</p> </blockquote> <p>Also the MVC Music Store PDF on p 77 indicates that the attrtibute will do the same -</p> <blockquote> <p>"Allows hiding fields from editor forms".</p> </blockquote> <p>They add it to the AlbumId property and then when the app is run AlbumId field is not shown in the browser. </p> <p>Is this attr broken?</p> <p>If i change a html helper to DisplayFor it does not appear in the form regardless of whether scaffoldcolumn is present. For example i dont have scaffoldcolumn false on Property PostTitle but if i change <code>@Html.EditorFor(Function(model) model.PostTitle)</code> to <code>displayfor</code> then it does not render regardless of the scaffoldcolumn attr. </p> <p>Also my Create view is strongly typed to <code>@ModelType RiderDesignMvcBlog.Core.Entities.Post</code></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload