如何提供的IEnumerable℃的EditorTemplate;为MyModel&GT ;? [英] How to provide an EditorTemplate for IEnumerable<MyModel>?

查看:155
本文介绍了如何提供的IEnumerable℃的EditorTemplate;为MyModel&GT ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能为IEnumerable的提供一个编辑模板(或者IList的,签单,为MyModel [],对于这个问题)?

Is it possible to provide an Editor Template for IEnumerable (Or IList, List, MyModel[], for that matter)?

推荐答案

我知道这是一个旧的文章,但你可以做的是创建一个名为模板 MyModelList 的需要的IEnumerable<为MyModel> ,然后你可以有一个 Html.EditorFor(X => x.MyModelList,MyModelList)

I know this is a old post but what you can do is make a template called MyModelList that takes IEnumerable<MyModel> and then you can have a Html.EditorFor(x => x.MyModelList, "MyModelList")

这篇关于如何提供的IEnumerable℃的EditorTemplate;为MyModel&GT ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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