.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old May 12th, 2008, 11:31 AM
cwfontan cwfontan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 68 cwfontan User rank is Corporal (100 - 500 Reputation Level)cwfontan User rank is Corporal (100 - 500 Reputation Level)cwfontan User rank is Corporal (100 - 500 Reputation Level)cwfontan User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 18 h 58 m 58 sec
Reputation Power: 2
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

Reply With Quote
  #2  
Old May 12th, 2008, 02:15 PM
dykebert dykebert is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 77 dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level)dykebert User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 19 h 28 m 45 sec
Reputation Power: 32
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.

Reply With Quote
  #3  
Old May 12th, 2008, 02:21 PM
cwfontan cwfontan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 68 cwfontan User rank is Corporal (100 - 500 Reputation Level)cwfontan User rank is Corporal (100 - 500 Reputation Level)cwfontan User rank is Corporal (100 - 500 Reputation Level)cwfontan User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 18 h 58 m 58 sec
Reputation Power: 2
date.now I believe is the .net version anyone can hlp with the syntax?

thanks though..

Reply With Quote
  #4  
Old May 12th, 2008, 02:33 PM
cwfontan cwfontan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 68 cwfontan User rank is Corporal (100 - 500 Reputation Level)cwfontan User rank is Corporal (100 - 500 Reputation Level)cwfontan User rank is Corporal (100 - 500 Reputation Level)cwfontan User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 18 h 58 m 58 sec
Reputation Power: 2
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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > Setting a text label only on first 10 days of the month


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway