Author: chintanpshah | Posted on: 11/5/2009 1:18:17 AM | Views : 415

I have a Gridview, in which I want to call one Extension method.
<%#Convert.ToString(Eval("BirthDate")).ToShortDate%>
My Extension Method:
Imports System.Runtime.CompilerServices Module DateExtensions <Extension()> _ Public Function ToShortDate(ByVal strDate As String) As String If DateTime.TryParse(strDate, New DateTime) Then Return Convert.ToDateTime(strDate).ToShortDateString Else Return String.Empty End If End Function End Module

I am able to call above Extension Method from Code-Behind but not from HTML Designer. Like:
<%#Convert.ToString(Eval("BirthDate")).ToShortDate%>
Any workaround?



...

Go to the complete details ...