Asp net validating date and time

asp net validating date and time-39

The Regular Expression attribute is used to limit what characters can be input. Code First ensures that the validation rules you specify on a model class are enforced before the application saves changes in the database.

For example, the code below will throw a Db Entity Validation Exception exception when the Having validation rules automatically enforced by the .

This one looks like it might fit: regexlib.com/REDetails.aspx?

[Required] [Display Format(Apply Format In Edit Mode = true, Data Format String = "")] public Date Time?

Start Time [Required] [Display Format(Apply Format In Edit Mode = true, Data Format String = "")] public Date Time Date The unobtrusive validation should work just fine with this expression. EDIT I've fixed the regular expression which started throwing errors in the console because of some illegal characters.

Comments