在我看来,我有类似的东西:
@model CreatorModel
<form name="myForm" action="/Creator/CreateAction" enctype="multipart/form-data" id="myForm" method="post">
<div class="a">
<h2 class="a">....</h2>
<div class="b">
<br />
Select a file for a <input type="file" name="aFile" id="aFile" />
<br /><br />
Select a file for b<input type="file" name="bFile" id="bFile" />
<br /><br />
<input type="submit" id="CreateAction" name="CreateAction" value="CreateAction" />
</div>
</form>
但我有一个错误:File /Creator/CreateAction is not found (CreateAction is an action from CreatorController)
<form...>
为了从控制器中查找操作,我可以输入什么作为操作?
当我使用这种语法时:
@using (Html.BeginForm("FileUpload", "Board", FormMethod.Post, new { enctype = "multipart/form-data" })) { <input type="file" /> <input type="submit" /> }
我也有一个错误:A reference is not set to an instance of an object"
也许有一个糟糕的路由?