lorena
Centurion
I have a little function that just checks to see whether a database field is a date or null and I wanted to be able to make it accessible from all the forms on the site it is attached to - so I did this:
My question is this: how do I access this function from within a datagrid, for example? This is the code I used but it doesn't work:
help?
Visual Basic:
Public Class ShortDateClass
Public Function showShortDate(ByVal aDate As Object)
If Not IsDBNull(aDate) Then
Return aDate.ToShortDateString
End If
End Function
End Class
Visual Basic:
<asp:TemplateColumn HeaderText="Sched Complete Date">
<ItemTemplate>
<asp:Label ID="lblSchedCompDate" Runat="server" text='<%#ShortDateClass.showShortDate(DataBinder.Eval(Container.DataItem,"sched_comp_date"))%>'/>
</ItemTemplate>
</asp:TemplateColumn>