在Razor语法中使用此
HTML助手时:
@Html.EditorFor(model => model.Prop1)
…该约定是将视图呈现在视图/< CrtView | Shared> /EditorTemplates/Prop1TypeName.cshtml下.
到现在为止还挺好.请注意,如果Prop1的(限定)类型为my.org.ns.TheType,则将呈现文件TheType.cshtml.
Prop1.GetType().FullName == "my.org.ns1.TheType"; Prop2.GetType().FullName == "my.org.ns2.TheType"; //same type name but different namespace
我叫这把剃刀:
@Html.EditorFor(model => model.Prop1) @Html.EditorFor(model => model.Prop2)
…我不能得到它为不同的类型显示不同的视图.
有没有办法消除歧义?
也许有更多关于.cshtml文件的命名约定的知识?
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。