Returning a Built-In EditorTemplate as a PartialView in an Action
-
27-10-2019 - |
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
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