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
Loading
paul danielPosted Feb 2, 2010, 1:33 AM
a function that evaluates if the datalist is in edit mode, if it is I return
false and hide the items. it works great!
John BarwellPosted Jan 31, 2010, 9:31 AM
The indicated method was how I would have gone about it under ASP.
I am looking for HOW to go about it under DOT NET
I have Tried using the if statemant to bind fileds dynamically, combined with eval, but got no where.
Please can anyone point me to a .net 3.5 VB example?
Sam HobbsPosted Jan 29, 2010, 8:10 PM
I am a beginner of ASP also, but it seems to me that you can use the Eval function. It might be the ASP way of doing what you need to do.