I got a date format like:
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
public DateTime? CreatedOn { get; set; }
Now, I want to make every datetime format in my application read from one config file. like:
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = SomeClass.GetDateFormat())]
public DateTime? CreatedOn { get; set; }
but this will not compile.
How can I do this?
See Question&Answers more detail:os