Is it possible to dynamically add an Editor Template to my view, after a button is clicked, for example?
At the moment I'm doing this in my main view to bind a list of ObjectA
objects to my model (inside a form):
@Html.EditorFor(x => x.ObjectA)
and in the Editor Template I'm binding the properties for ObjectA
:
@Html.DisplayFor(x => x.ID)
@Html.CheckBoxFor(x => x.BoolA)
But if I don't want to always load this editor template, is there a way to bind it dynamically to the model, using JS?
It's because it makes an additional request to the Database which I can omit by allowing the user to choose whether or not to make the request.
Is this possible?