Html.EditorForModel犯规渲染复杂的类型 [英] Html.EditorForModel doesnt render complex types

查看:117
本文介绍了Html.EditorForModel犯规渲染复杂的类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一类具有这个属性。

I have a class with this property

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

然后在我看来,我叫Html.EditForModel(),然而属性犯规表演,我甚至有模板在我的控制器的观点文件夹,然后EditorTemplates,我用剃刀和我的看法是不是强类型,它会带来什么呢?

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?

推荐答案

默认情况下编辑/显示模板世系对象层次结构只有一个级别。这里有一个<一个href=\"http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-4-custom-object-templates.html\">excellent从布拉德·威尔逊的博客文章的描述,你怎么可能有哪些下降超过1级的编辑模板。

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.

这篇关于Html.EditorForModel犯规渲染复杂的类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆