Hi All,
I want to bind a collection using a prefix, like so
public ActionResult Whatever([Bind(Prefix = "Prefix")] CustomModel[] models)
I created form elements using
<%= Html.TextBox("Prefix.models[" + i + "].Property") %>
which generated html inputs like this
<input id="Prefix_models[0]_Property" name="Prefix.models[0].Property" />
My problem is that the default model binder will not bind with a prefix. I get null for the models arg in the action method.
If I strip the prefixes from the html and remove the Bind attribute, everything works fine. I cannot imagine that the default model binder won't handle a prefix on a collection, so I must be doing something wrong.
Please help. Cheers!