这是我的代码:
我需要将数据传递给控制器。
@{
DateTime today = DateTime.Now; //current date
DateTime firstDay = today.AddDays(-(today.Day - 1)); //first day
today = today.AddMonths(1);
DateTime lastDay = today.AddDays(-(today.Day)); //last day
}
//@using (Html.BeginForm())
//{
//<fieldset>
<br /><br />
<h2>Please select date range for the report</h2>
<table>
<tr>
<td>Begin Date</td>
<td>
@(Html.Telerik().DatePicker()
.Name("BeginDate")
.ShowButton(true)
.Value(firstDay)
)
</td>
</tr>
<tr>
<td>End Date</td>
<td>
@(Html.Telerik().DatePicker()
.Name("EndDate")
.ShowButton(true)
.Value(lastDay)
)
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Show Report" />
</td>
</tr>
</table>
//</fieldset>
//}
datepicker 没有绑定到模型,我需要我正在使用的网格数据的值。(telerik 网格 ajax)
我还想阻止用户输入大于 BeginDate 的 Enddate
谢谢