In my mvc application I have stored my date in string format. eg: 10212013
But I would like to display that sting as a date in my UI eg: 10/21/2013
How to archive this?? Is it possible to user DisplayFormat
for this purpose.
EDIT
This is what I need to do.
@Html.DisplayFor(model => DailyTransaction.MyDate)
Datatype of MyDate is string so this will display as 10212013
But I need to display this as 10/21/2013
can I use string format inside the view of MVC project
I tried to use the following and that is also did not work for me.
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
public string MyDate{ get; set; }