I've got a model:
public class OverdraftForm
{
public string CustomerId { get; set; }
public PaymentType PaymentType { get; set; }
public OverdraftType Type { get; set; }
public decimal PermanentAmount { get; set; }
public int ExpirationPeriod { get; set; }
public decimal OnetimeAmount { get; set; }
public DateTime ExpirationDate { get; set; }
public CreditType CreditType { get; set; }
public string Comment { get; set; }
}
And my action is
public ActionResult CreateOverdraft(OverdraftForm form)
{
if (form.Type == OverdraftType.Permanent)
return CreatePermanentOverdraft(form);
return CreateOnetimeOverdraft(form);
}
The point is when I debug it, even on the first line of action ModelState.IsValid is false, and it says that OnetimeAmount should have a value. I'm using MVC2, I guess some changes to it cause this problem.