I have two view models as below
public class hdr_doc_upload
{
public string document_name { get; set; }
public HttpPostedFileBase UpFile { get; set; }
}
public class list_doc
{
public List<hdr_doc_upload> hdr_doc_upload { get; set; }
}
Controller
public ActionResult Create_Group()
{
list_doc list = new list_doc();
return View(list);
}
View
@Html.TextBoxFor(model => model.hdr_doc_upload[0].document_name)
<input type="file" id="hdr_doc_upload[0].UpFile" name="hdr_doc_viewmodel[0].UpFile" />
@Html.TextBoxFor(model => model.hdr_doc_upload[1].document_name)
<input type="file" id="hdr_doc_upload[1].UpFile" name="hdr_doc_viewmodel[1].UpFile" />
Give me below screen
but when i submit the page we only getting the textbox values the file is getting as null.