Created
May 28, 2013 12:15
-
-
Save pgregorynz/5662342 to your computer and use it in GitHub Desktop.
Because MVC doesnt have an EditorFor input types of files this little trick lets you get around that rather than having to hardcode your input. You change the type of the texbox to be of type file.
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 model property for Upload is of type HttpPostedFileBase *@ | |
@* rather than doing having to hardcode <input type="file" name="upload" id="upload" /> *@ | |
@Html.TextBoxFor(model => model.Upload, new{type="file"}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment