In View
<td class="SrcFld">
<div>
@Html.TextBox("BeginDate", Model.BeginDate)
@Html.RequiredFieldFor(model => model.BeginDate)
@Html.ValidationMessageFor(model => model.BeginDate)
To @Html.TextBox("EndDate", Model.EndDate)
@Html.RequiredFieldFor(model => model.EndDate)
@Html.ValidationMessageFor(model => model.EndDate)
</div>
</td>
In Model
>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Foolproof;
namespace HPAI.HPA.Web.Models
{
public class UnEmploymentInputs : UserInputs
{
[Required]
public DateTime? BeginDate { get; set; }
[Required]
[GreaterThan("BeginDate", ErrorMessage = "End Date Should be Greater Than Begin Date.")]
public DateTime? EndDate { get; set; }
public decimal? NonEscrowTax { get; set; }
public decimal? NonEscrowInsurance { get; set; }
public bool? IsExtension { get; set; }
public bool? IsIncomeCircumstance { get; set; }
}
My Question, validation of end date and begin date required fields are working.but Greater Than validation is not working.actually i am using "foolproof" validations.please help me out.Thanks!!