Я пытался воссоздать тысячи простых примеров в сети, и каждый раз терпел неудачу.
Что я делаю не так?
Other.aspx
<%@ Page Title="" Language="VB" MasterPageFile="~/Views/Shared/Site.Master"
Inherits = "System.Web.Mvc.ViewPage"%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent"
Runat = "сервер">
Другой
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent"
Runat = "сервер">
<h2>Upload A File</h2>
<% Html.BeginForm("UploadFile", "Home")%>
<input type="file" name="f" />
<input type="submit" />
<% Html.EndForm()%>
</form>
</asp:Content>
_
Public Class HomeController
Наследует System.Web.Mvc.Controller
Function Index() As ActionResult
ViewData("Message") = "Welcome to ASP.NET MVC!"
Return View()
End Function
Function About() As ActionResult
Return View()
End Function
<HttpPost()> _
Sub UploadFile(f As HttpPostedFileBase) <---Breakpoint here, f is always "Nothing"
RedirectToAction("Other")
End Sub
Function Other() As ActionResult
Return View()
End Function
End Class