L
labelle
I have an event listing on my website that is pulling from SQL.
Unfortunately, the listing is displaying all events, especially those
that are even 2 years old. I want to get rid of them and only display
events that are today or in the future. I need help!
Dim tmpEvents As Events
tmpEvents = New EventsMapper().GetEvents()
Dim tmpEvent As New [Event]
Dim tmpEventListing As String
For Each tmpEvent In tmpEvents
tmpEventListing += "<font style='font-family: Verdana;
font-size: 10px;'>" & tmpEvent.StartDate & "</font>" & " <br> " &
"<font style='font-family: Verdana; font-weight: bold; font-size:
10px;'>" & "<A href=javascriptpenpopup3(" & tmpEvent.ID.ToString &
")>" & tmpEvent.Title & "</a>" & "</font>" & "<br><br>"
If tmpEvent.StartDate <= Date.Now.ToShortDateString
Then
Label2.Text = tmpEventListing
Else
Label2.Enabled = False
End If
Next
This displays all the events, but does nothing for events in the past.
Can you help?
Unfortunately, the listing is displaying all events, especially those
that are even 2 years old. I want to get rid of them and only display
events that are today or in the future. I need help!
Dim tmpEvents As Events
tmpEvents = New EventsMapper().GetEvents()
Dim tmpEvent As New [Event]
Dim tmpEventListing As String
For Each tmpEvent In tmpEvents
tmpEventListing += "<font style='font-family: Verdana;
font-size: 10px;'>" & tmpEvent.StartDate & "</font>" & " <br> " &
"<font style='font-family: Verdana; font-weight: bold; font-size:
10px;'>" & "<A href=javascriptpenpopup3(" & tmpEvent.ID.ToString &
")>" & tmpEvent.Title & "</a>" & "</font>" & "<br><br>"
If tmpEvent.StartDate <= Date.Now.ToShortDateString
Then
Label2.Text = tmpEventListing
Else
Label2.Enabled = False
End If
Next
This displays all the events, but does nothing for events in the past.
Can you help?