Hi I want to make a create form for ‘Product’ Model, which it-self contains collection of ‘Pictures’, in this manner :
<%:Html.TextBoxFor(x=> x.ProductID)%>
.....
......
<%Htm.EditorFor(x=>x.Pictures)%>
And I made an editor template for Picture :
<input type="file" name="?" id="?">
<%:Html.TextBoxFor(y=>y.PictureName)
As you know the mvc gives a unique name for each of collection controls such :
<input type="text" id="Picture[0].PictureName" ....
But I want it also for upload control, I mean give a different name for each Picture`s uplaod control.
Is there any way?
Yes there is. In your editor template: