发表日期不能大于当前时间----验证
<asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txtPublishDate"
ErrorMessage="RangeValidator" MinimumValue="1900-01-01" Type="Date">发表日期不能大于当前时间</asp:RangeValidator>
ErrorMessage="RangeValidator" MinimumValue="1900-01-01" Type="Date">发表日期不能大于当前时间</asp:RangeValidator>
-----上面是前台代码
-----下面是后台代码
protected void Page_Load(object sender, EventArgs e)
{
this.RangeValidator1.MaximumValue = DateTime.Now.ToShortDateString();
.......{
this.RangeValidator1.MaximumValue = DateTime.Now.ToShortDateString();
}