Is there any way I can not lose data from HttpPostedFileBase
? my action does a check, and in case of failure the page reloads with the image in the form and I have to make the call again, then HttpPostedFileBase
will be null, unless I choose the image again.
@{
Dictionary<string, object> htmlAttributes = new Dictionary<string, object>();
htmlAttributes.Add("id", "delivery-form");
htmlAttributes.Add("class", "middle-forms");
htmlAttributes.Add("enctype", "multipart/form-data");
}
@using (Html.BeginForm(actionName, "DeliveryService", ViewBag.Routes as RouteValueDictionary, FormMethod.Post, htmlAttributes @*new { @id = "delivery-form", @class = "middle-forms" }*@))
{
SecondCall:
UPDATE
OneworkaroundIcameupwithwastouseSession
tosaveHttpPostedFileBase
data,thus:
Session["ImportFile"] = ImportFile;