I'm trying to use some extension methods that I use to apply consistent formatting to DateTime and Int32 - which works absolutely fine in code behind, but I'm having issues with databinding.
I get:
'System.DateTime' does not contain a definition for 'ToCustomShortDate'
for
<%# ((ProductionDetails)Container.DataItem).StartDate.ToCustomShortDate() %>
(inside a templatefield of a gridview contained on a usercontrol)
Even when I'm including the namespace that the extension method is defined in at the top of the usercontrol:
<%@ import namespace="MyAssembly.Formatting" %>
Has anyone else come across this and is there any way to resolve it?
EDIT: My mistake, above should be:
<%@ import namespace="MyNamespace.Formatting" %>
ie. I'm not incorrectly referencing the namespace (works vertabim in the code behind)