Friday, 7 July 2017

MVC model validation Example & RegularExpression


  using System.ComponentModel.DataAnnotations;

 [AllowHtml]
  [Required]
  [Display(Name = "IFSC CODE")]
  [RegularExpression(@"[A-Za-z]{4}[0]\d{6}", ErrorMessage = "* Invalid IFSC CODE")]
  //[RegularExpression(@"[A-Za-z]{5}\d{4}[A-Za-z]{1}", ErrorMessage = "* Invalid PAN Number")]
  public string IFSCCODE { get; set; }
  

No comments:

Post a Comment

SQL CharIndex Example

DECLARE  @PW_MPID NVARCHAR( max )   set  @PW_MPID= '1555|2555|35|'       DECLARE  @PW_MPIDPostion  Varchar ( max ) = CHARINDEX(...