送信ボタンをクリックした後。エンティティで null を取得しています。 誰にも解決策がありますか?
意見
@using (Ajax.BeginForm("CreateRoom", "Room", new AjaxOptions { HttpMethod = "POST", OnComplete = "window.location.href='Index'" }, new { enctype = "multipart/form-data", id = "ajaxUploadForm" }))
{
<input type="file" name="Room" />
<input type="submit" value="OK" />
}
コントローラ
[HttpPost]
public ActionResult CreateRoom(RoomFileView entity)
{
//code
}
モデル
public class RoomFileView
{
public RoomFileView();
public int BuildingId { get; set; }
public int CityId { get; set; }
public int CountryId { get; set; }
public int FloorId { get; set; }
public int LocationId { get; set; }
public HttpPostedFileWrapper Room { get; set; }
public string Content();
}