Forcing EditorFor to prefix input items on view with Class Name?
- by Kohan
I have an EditorFor:
<%: Html.EditorFor(model => model.Client, "ClientTemplate", new { editing = false })%>
This will bind coming down to the view fine (as expected) but will not bind bind back when the model gets posted.
This is due to the form id's not being prefixed with "Client."
Usually in this situation i just pass in model and then bind the inputs to model.Client.PropertyName in the Template but this is not an option in this case as the template is used on two different viewmodels (that have client on).
Any suggestions on getting this to bind properly?
Many thanks,
Kohan.