Reputation: 23841
I have the following binding in my GridView:
Text='<%# Bind("FromDate", "{0:dd/MM/yyyy}") %>'
I would take the format from the web config instead of hard coded value.
'<%$ AppSettings:EditDateFormat %>'
How can I do that?
Upvotes: 2
Views: 74
Reputation: 2574
How about this? this should work,
Text='<%# Bind("FromDate", "{0:" + System.Configuration.ConfigurationManager.AppSettings["EditDateFormat"]) +"}" %>'
Upvotes: 1