在我看来,我有这段代码:
<% using (Html.BeginForm("TradeUKKPIShowData", "Report")) //action/controller
{ %>
<div style="padding: 10px; background-color: #eeeeee; width: 300px; border: 1px solid #cccccc;">
<div style="float: left; width: 150px; padding-top: 3px;">
<%: Html.Label("Select a Sunday:") %>
</div>
<div style="float: left; width: 150px;">
<%: Html.DropDownListFor(model => model.SelectedSunday, Model.AllSundays) %>
</div>
<div class="clear"></div>
</div>
<div style="text-align:right; width: 272px; padding-top: 30px;">
<input type="submit" id="search-submit" value="Submit"/>
</div>
<% } %>
控制器中的动作:
public ActionResult TradeUKKPIShowData(DateTime date) //this date value is null thus error
{
var reportData = _reportingService.GetTradeUKKPISearches(date);
ViewBag.reportdate = date;
return View(reportData);
}
我收到一条错误消息,指出传递的参数 date 为 null 我哪里出错了?