I am working on MVC. I have a form to send Email. The razor form is below
@Ajax.BeginForm("sendEmail", "communication", new AjaxOptions() { OnBegin = "return onBeginFun();", UpdateTargetId = "emailMessage" }, new { id = "communicationForm", enctype = "multipart/form-data" })
{
@Html.TextAreaFor(m => m._Email.Body, new { @class = "form-control editor overflow:scroll; max-height:300px", name = "emailbody", id = "emailbody" })
<input type="file" id="fileUploader" name="fileUploader" multiple ;" />
<button type="submit" id="submitCommunication"> SAVE>>></button>
}
The controller is as follows
[HttpPost]
[ValidateInput(false)]
public async Task<JsonResult> sendEmail(CommunicationModelView P_CMV, HttpPostedFileBase fileUploader)
{
....................
}
Upon clicking submit button I can see the Model filled with the form data, but fileUploader is null even though I have selected file(s).
Need help. Thanks in advance.