|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Setting a text label only on first 10 days of the month
asp.net vb
I want to set a label to something only if the condition first 10 days of any month is met. Any help or diretion thanks.. the below throws error saying BC30108: 'Date' is a type and cannot be used as an expression Code:
if (DatePart("d",Date)) < 10 then
Dim LabelReminder as New Label()
LabelReminder.Text = "Reminder - Monthly Safety Meeting Reports and Monthly Worksite Inspection Reports are due in the Safety Office by May 10th."
Controls.Add(lblMessage)
end if
|
|
#2
|
|||
|
|||
|
Date is a reserved word for a data type.
If you've declared a variable or field named Date you should change the name to Dt or currDate or something to avoid this confusion/error. If you meant to use Date to return today's date then you might try the function now() instead. I haven't programmed in .Net so I may not have the correct function but there should be something comparable. |
|
#3
|
|||
|
|||
|
date.now I believe is the .net version anyone can hlp with the syntax?
thanks though.. |
|
#4
|
|||
|
|||
|
here it is if anyone else needs it.. i answered my question posting to dykebert..
Code:
sub pageload_
if (DatePart("d",Date.Now)) < 12 then
labelReminder.Text = "Reminder - Monthly Safety Meeting Reports and Monthly Worksite Inspection Reports are due in the Safety Office by May 10th."
end if
|
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > Setting a text label only on first 10 days of the month |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|