Reputation: 87
I need upload image with model. But editorfor showing a different html control.
Model
<Required(ErrorMessage:="Logo is Required")>
<DataType(DataType.Upload)>
<Display(Name:="Logo", ResourceType:=GetType(RestaurantModelStrings))>
Public Property Logo As HttpPostedFileBase
View
@Html.EditorFor(Function(m) m.Logo)
Upvotes: 0
Views: 285
Reputation: 62488
Use TextBoxFor
like this:
@Html.TextBoxFor(Function(m) m.Logo, new { type = "file" })
Upvotes: 2