After clicking the submit button. I am getting null in entity. Do anyone have a solution?
View
@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" />
}
controller
[HttpPost]
public ActionResult CreateRoom(RoomFileView entity)
{
//code
}
model
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();
}