How can I dynamically HIDE / SHOW items in a DataList Control based on data field values

Jan 28 2010 7:14 PM

Basically I want to either hide of show the content of different database fields based on if todays date is between a sart date field value and an end date field value.
In the olden days of asp-vb I would open the recordset, loop thru it using an if statement. - Following is logic, not code
if todays date < date_end and todays date > date_start then
response.write(rs("field_a"))
else
response.write(rs("field_b"))
end if
I am using a Master Page and code in an associated .vb page.
Does anyone have any idea on how to do the same thing in a .net DataList contol as I am getting nowhere and almost lost my hair as a consequence?
Many many thanks for your time.
Frustrated .net newbee

Answers (3)