Mr Bell
Mr Bell

Reputation: 9368

How to provide an EditorTemplate for IEnumerable<MyModel>?

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

Upvotes: 0

Views: 1288

Answers (1)

Manatherin
Manatherin

Reputation: 4187

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")

Upvotes: 2

Related Questions