My view:
using (Ajax.BeginForm("Create", "CustomerEngagement", null, new AjaxOptions { OnSuccess = "closePopUpAndShowNextPost", InsertionMode = InsertionMode.Replace, HttpMethod = "post" }, new { @id = "create" }))
{
// Lots of things going on here
// I need to implement fileupload to upload attachments asynchronously here
<input name="fileupload1" id="fileupload1" multiple type="file" />
<button id="fileupload" name = "upload">
//Button to submit the form
<button id="save" value="save">
}
Controller :
[HttpPost]
public ActionResult Create(string word, StudentModel model)
{
List<string> synonyms = new List<string>();
List<string> sugg = new List<string>();
//Doing lot of stuff here
// I'm trying to get httppostedfilebase here but its null, also request.Files[] coming null.
}
I think in ajax.beginform
file is not uploaded, can we have any other solution here?