I\'m trying to upload a file using Ajax.BeginForm(), but it\'s not working out.
My view contains:
@using (Ajax.BeginForm(\"UploadFile\", null, new Aj
very simple solution:
@using (Ajax.BeginForm("action", "controller", new AjaxOptions
{
HttpMethod = "post",
InsertionMode = InsertionMode.Replace,
OnBegin = "startLoader",
OnSuccess = "Update_Record",
UpdateTargetId = "Succ_Msg"
},new { enctype = "multipart/form-data" }))
notice the new { enctype = "multipart/form-data" }
which tells the razor page to add the enctype that can pass HttpPostedFileBase
good luck:).