I have an sql server table of items which have expiration dates.
I have a datareader 'dtrlist' filled by an sql sever select .executereader command.
I have a datalist 'dlstlist' defined as:
dlstlist.datasource = datalist
dlstlist.DataKeyField = 'listingid' (a unique column from the sql table)
dlstlist.databind()
The datalist has a template with a column that shows the listingid, the item name, the expire date and a button labled 'Extend'. Clicking on this button will add time to the expire date. If the expire date is in the future the button is disabled other wise it needs to be enabled.
I need to know how to do the following.
When the page is rendered it needs to test each expire date against the system date.
If the item has expired the 'Extend' button will become enabled.
Where do I put the if...then and how do I reference each of the expire dates and extend buttons.
Thanks for any help.
Oakgrove Computer Grouper
Lansing, MI
I have a datareader 'dtrlist' filled by an sql sever select .executereader command.
I have a datalist 'dlstlist' defined as:
dlstlist.datasource = datalist
dlstlist.DataKeyField = 'listingid' (a unique column from the sql table)
dlstlist.databind()
The datalist has a template with a column that shows the listingid, the item name, the expire date and a button labled 'Extend'. Clicking on this button will add time to the expire date. If the expire date is in the future the button is disabled other wise it needs to be enabled.
I need to know how to do the following.
When the page is rendered it needs to test each expire date against the system date.
If the item has expired the 'Extend' button will become enabled.
Where do I put the if...then and how do I reference each of the expire dates and extend buttons.
Thanks for any help.
Oakgrove Computer Grouper
Lansing, MI