cptc
cptc

Reputation: 87

Asp.net MVC File Upload Does Not Show File Input

I need upload image with model. But editorfor showing a different html control.

enter image description here

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

Answers (1)

Ehsan Sajjad
Ehsan Sajjad

Reputation: 62488

Use TextBoxFor like this:

 @Html.TextBoxFor(Function(m) m.Logo, new { type = "file" })

Upvotes: 2

Related Questions