ryudice
ryudice

Reputation: 37466

Html.EditorForModel doesnt render complex types

I have a class with this property

        [Display(Name = "Estado Civil"),UIHint("EstadoCivil"),ScaffoldColumn(true)]
    public virtual EstadoCivil EstadoCivil { get; set; }

then in my view I call Html.EditForModel(), however the property doesnt show, I even have the template in my Controller's views folder and then "EditorTemplates", I'm using razor and my view is not strongly typed, would that have something to do?

Upvotes: 4

Views: 4172

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039508

By default editor/display templates descent only one level in the object hierarchy. Here's an excellent blog post from Brad Wilson which describes how you could have an editor template which descends more than 1 level.

Upvotes: 5

Related Questions