File upload bound to the Viewmodel

前端 未结 2 1281
南方客
南方客 2020-12-16 20:57

I have a form where I am uploading multiple files and there are a couple of textboxes and some checkboxes associated with each file being uploaded. I have seen examples for

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-16 21:05

    The fix to this is changing the way you Name and ID the upload control.

    <%: Html.TextBoxFor(model => model.EmpName, new { maxLength = 50 })%>
    
    Upload your files here: 
    
    <%: Html.TextBoxFor(model => model.FileUploadPackets[0].UserEnteredDesc )%>
    
    
    <%: Html.TextBoxFor(model => model.FileUploadPackets[1].UserEnteredDesc )%>
    

    This worked for me!! Hope it helps anyone else out there..

提交回复
热议问题