How to create MVC 4 @Html.TextBox type=“file”?

后端 未结 7 2138
萌比男神i
萌比男神i 2021-02-20 14:57

I need to add the following field at my form


I create model and describe this field (the las

7条回答
  •  忘了有多久
    2021-02-20 15:27

    I think you are getting a null because you have not specified the enctype in your form tag.

    @using (Html.BeginForm("ActionMethodName", "Controller", FormMethod.Post, new { enctype = "multipart/form-data" })) { }

    A working example always help.

    Visit http://www.mindstick.com/Articles/cf1e1dd9-fdba-4617-94f0-407223574447/?Upload%20File%20in%20Asp.Net%20Mvc%204

提交回复
热议问题