Created
February 11, 2015 21:20
-
-
Save johnmmoss/30b396d2377fb188c08d to your computer and use it in GitHub Desktop.
ASP.NET Razor View for File Upload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The view needs to have the enctype set to multipart form data, also, TextBoxFor takes type of file | |
@using (Html.BeginForm("Statement", "Customer", FormMethod.Post, new { enctype = "multipart/form-data" })) | |
{ | |
// Sample Razor | |
<div class="form-group"> | |
@Html.LabelFor(m => m.CustomerStatementFile, new { @class = "control-label" }) | |
<div class="col-sm-10"> | |
@Html.TextBoxFor(m => m.CustomerStatementFile, new { @class = "form-control", type = "file" }) | |
</div> | |
</div> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment