I have an editor for:
<%: Html.EditorFor(model => model.Client, "ClientTemplate", new { editing = false })%>
This will bind the transition to a beautiful view (as expected), but will not bind the binding back when the model is sent. This is because the form identifier is not the "Client" prefix.
Usually in this situation, I just pass the model and then bind the inputs to model.Client.PropertyName in the template, but this is not an option in this case, since the template is used on two different viewing models (with the client).
Any suggestions on properly binding this object?
Thanks a lot, Cohan.
Adding
It seems to be a misunderstanding on my part, a problem, as I now understand that fluentHtml does not work inside EditorFor Templates. (The same goes for this fix, which, as it turned out, was not necessary, because EditorFor would prefix for me automatically if I replaced fluentHtml with the usual mvc html helpers)
source
share