I am trying to upload image using Ajax.BeginForm but in my controller the file shows null. My code is:
@using (Ajax.BeginForm("Create", "PriceManager", new AjaxOptions { HttpMethod = "Post", InsertionMode = InsertionMode.Replace, UpdateTargetId = "PriceList", OnSuccess = "ClearInputField", OnFailure = "Fail", OnComplete = "Complete" }, new { enctype= "multipart/form-data" })) I even tried using Html.Begin :
@{ var attributes = new Dictionary<string, object>(); attributes.Add("data-ajax-complete ", "Complete"); attributes.Add("data-ajax-mode", "replace"); attributes.Add("data-ajax-update ", "#PriceList"); attributes.Add("id", "form0"); attributes.Add("enctype", "multipart/form-data"); attributes.Add("data-ajax", "true"); } @using (Html.BeginForm("Create", "ProductManager", FormMethod.Post,attributes)) Still the file value remain null. Any idea what I am doing wrong here. Thanks

Ajax.BeginForm()(your 2nd attempt is just mimickingAjax.BeginForm()). If you want to use ajax, then use$.ajax()with the correct options and passingFormData- refer how to append whole set of model to formdata and obtain it in MVC