[RegularExpression("", ErrorMessage = " Affordable fees cannot be Zero or Negative.")]
public decimal AffordablePayment { get; set; }
我需要数据注释验证中的错误消息的正则表达式。请帮帮我。谢谢!
答案 0 :(得分:4)
[Range(0.01, double.MaxValue, ErrorMessage = "Affordable fees cannot be Zero or Negative.")]
public decimal AffordablePayment { get; set; }
答案 1 :(得分:0)
试试这个:
(^\d*\.?\d*[1-9]+\d*$)|(^[1-9]+\d*\.\d*$)