Returning a Built-In EditorTemplate as a PartialView in an Action

Is there a way to return a built-in editor template - not a custom editor template - as a PartialView in an action?

I'd like to do something like this:

return PartialView("Collection", person.Children);

Thanks in advance

Answers


AFAIK there is no way to do this from a controller action. You could return a custom partial view:

return PartialView(person.Children);

that will invoke the editor template:

@model IEnumerable<Foo>
@Html.EditorForModel()

Need Your Help

Binding Controls to a Settings File

vb.net data-binding settings

I want to be able to control several groups of settings independently of each other. I'd originally used My.Settings, but it was too much work to manually rollback some settings whilst saving other...

IF EXISTS conditions within multiple statements joined by a union

sql sql-server sql-server-2008

I have been working on a problem for a few hours and I feel like I'm running in circles.