Pergunta

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

Foi útil?

Solução

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()
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top