你应该包括
cardid
<form>
,它什么也不做。
<h3>@Model.CV.Id</h3>
@using (Html.BeginForm("UploadFile", "Tickets", FormMethod.Post, new { enctype = "multipart/form-data"}))
{
<input type="hidden" name="cardid" value="@(Model.CV.Id)" />
<input type="file" name="file" />
<input type="submit" value="Upload Attachment" />
}
您还可以在操作中包含“cardid”:
Html.BeginForm("UploadFile?cardid=" + Model.CV.Id, "Tickets", FormMethod.Post...)