Zack Peterson
Zack Peterson

Reputation: 57353

How do I control the DisplayForModel method in ASP.NET MVC 2?

If I use DisplayForModel in a strongly-typed ASP.NET MVC 2 View with an EntityObject model, then unwanted field labels are displayed:

How can I control the output to hide these?

Upvotes: 0

Views: 1447

Answers (1)

ten5peed
ten5peed

Reputation: 15890

Personally I would create a view specific presentation model with only the fields I wanted to display.

If you haven't already seen the blog post series from Brad Wilson on display templates, I would recommend reading over them.

In part 2 he mentions the ShowForDisplay piece of metadata, but I couldn't find where to set or manipulate it.

HTHs,
Charles

Upvotes: 3

Related Questions