File Upload Controls using Razor in ASP.NET MVC3

前端 未结 3 679
故里飘歌
故里飘歌 2021-02-13 05:53

Is there a way to define the file upload controls using a Razor helper in ASP.NET MVC3?

3条回答
  •  青春惊慌失措
    2021-02-13 06:45

    There isn't an html helper for file inputs, but what is wrong with just doing

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

提交回复
热议问题