Question
January 27, 2010 at 03:30 PM
sloopjohnb27

asp:DataList – How can I use if statement based on dates in fields returned

by sloopjohnb27 . Updated 16 years, 7 months ago

Basically trying to display contents of 2 fields of a recordset if todays date is between the start date field and end date fields.
I am trying this in an asp:DataList control under .net 3.5
The following is getting me nowhere:

‘Dim TodaysDate As Date = Date.Today
‘If Eval(“StartDate”) <= TodaysDate And Eval("EndDate") >= TodaysDate Then
‘ Response.Write(“Call ” & Eval(“Contact”) & “
“)
‘Else
‘ Response.Write(“Please watch this space”)
‘End If

Help v-greatfully appreciated
John :?)

This discussion is locked

All Comments