I have a view which look like this
@model UI.Models.BidOnAuctionViewModel
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@{
var disableButton = Model.AuctionOpen ? "" : "bid-btn-disabled";
}
@using (Html.BeginForm("ConfirmBid", "Lot"))
{
<fieldset>
@Html.HiddenFor(model => model.AuctionId)
<p>
<label >£@Model.NextBidAmount</label>
</p>
<p>
@if (Model.AuctionOpen)
{
<input type="submit" value="Place bid" class="bid-btn @disableButton" />
}
</p>
</fieldset>
}
When I click on the Place bid button, I go to the confirmBid action method
[Authorize]
[HttpPost]
public ActionResult ConfirmBid(BidOnAuctionViewModel model)
The problem is that even though in the view the model was not null, for some reason it is null in this action method. Why is this?