Any sample code for file upload in PopupForm?

Jul 26, 2016 at 6:36 AM
Hello I am trying to upload a file from popup however its giving null to the file property.

Any advise?

Below is my sample code: NOTE: submit button is used from default popup form.

@using (Html.BeginForm("AddAttachment", "Attachment", FormMethod.Post, new { enctype = "multipart/form-data", id = "UploadFileForm" }))
{
<div class="row">
    <div class="col-md-5">
        <div class="form-group">
            @Html.LabelFor(model => model.Title, new { @class = "" })
            @Html.TextBoxFor(model => model.Title, new { @class = "form-control" })
            @Html.ValidationMessageFor(model => model.Title)
        </div>
    </div>
    <div class="col-md-5">
        <div class="form-group">
            @Html.LabelFor(model => model.DataFile, new { @class = "" })
            @Html.TextBoxFor(m => m.DataFile, new { type = "file", name = "DataFile" })
            @Html.ValidationMessageFor(m => m.DataFile)
        </div>
    </div>        
</div>
}
Coordinator
Jul 26, 2016 at 7:27 AM
you need to use an ajax file upload plugin
Jul 26, 2016 at 7:34 AM
Any sample code?