我知道有很多这样的问题,但我都阅读了它们,但其中没有一个解决了我的问题。下面我将展示我在视图和控制器中拥有的代码,以便您了解我的代码。
View :
<td><% using (Html.BeginForm("Index", "Home", FormMethod.Post, new {enctype = "multipart/form-data"})) { %>
<%: Html.ValidationSummary(true) %>
<div id="section1">
<div class="editor-label">
<%: Html.LabelFor(model => model.Name) %>
</div>
<label for="file">Filename:</label>
<input type="file" name="myfile" id="File5" value="Choose File Banner1" />
<p> </p>
And here is my controller:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index(HomeModel model, string submitButton, HttpPostedFileBase myfile)
{
我不知道是什么螨虫问题..有人可以帮我吗