Skip to content

Instantly share code, notes, and snippets.

@iamandycohen
Created June 3, 2013 16:30
Show Gist options
  • Save iamandycohen/5699393 to your computer and use it in GitHub Desktop.
Save iamandycohen/5699393 to your computer and use it in GitHub Desktop.
FileUploadFor
using MvcInputExtensions = System.Web.Mvc.Html.InputExtensions;
public static class InputExtensions
{
public static MvcHtmlString FileUploadFor<TModel, TProperty>(this HtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression)
{
return MvcInputExtensions.TextBoxFor<TModel, TProperty>(html, expression, htmlAttributes: new { type = "file" });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment