rivkamak
asked on
checking for day of week in asp.net
How would I write this if statement in asp.net?
i need a check to see if the day of the week is not Friday or saturday in VB.net
<% if WeekdayName(weekday(date)) <> "Friday" and WeekdayName(weekday(date)) <> "Saturday" then %>
i need a check to see if the day of the week is not Friday or saturday in VB.net
<% if WeekdayName(weekday(date))
If Weekday(Date) = vbSaturday Or Weekday(Date) = vbSunday Then
ASKER
I got the following errors on both of yours
@: jss1199: C32093: 'Of' required when specifying type arguments for a generic type or method.
@TheAvenger:BC30469: Reference to a non-shared member requires an object reference.
@: jss1199: C32093: 'Of' required when specifying type arguments for a generic type or method.
@TheAvenger:BC30469: Reference to a non-shared member requires an object reference.
hi...
please use this
System.DateTime.Now.DayOfW eek
please use this
System.DateTime.Now.DayOfW
ASKER
so what is wrong with this?
'if System.DateTime.Now.DayOfW eek = "Saturday" Or System.DateTime.Now.DayOfW eek <> "Friday" Then
error: System.FormatException: Input string was not in a correct format.
'if System.DateTime.Now.DayOfW
error: System.FormatException: Input string was not in a correct format.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It would be something like:
<% if date.DayOfWeek <> DayOfWeek.Friday and date.DateOfWeek <> DayOfWeek.Saturday then %>