Hi,
I am developing a calendar webpage that displays 14 months from the current date. I keep getting this error while trying to view the page and I'm guessing that its down to too much info needing to be processed. Can anyone help? Heres my code:
thanks
holmags
I am developing a calendar webpage that displays 14 months from the current date. I keep getting this error while trying to view the page and I'm guessing that its down to too much info needing to be processed. Can anyone help? Heres my code:
Code:
<TABLE COLS="7" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<%
Response.Write "<td></td>"
For iweek = 1 to 5
For DayLoop = 1 to 7
Response.Write "<td bgcolor='Yellow'>" & WeekDayName(Dayloop, True, 0)& "</td>"
Weekname = Weekname + 1
Next
Next
Weekname = Weekname + 1
Response.Write "<td bgcolor='Yellow'>Mon</td>"
Response.Write "<td></td>"
Response.Write "</TR>"
For iMonth = 1 to 14
dtToday = Date()
CurrentMonth = Dateadd("m",count, dtToday)
'Gets the year based on the variable TheDate
CurrentYear = Year(dtToday)
'This is used to get the month name for TheDate
CurrentMonthName = MonthName(datepart("m", CurrentMonth))
'DateSerial will format the year, month and date and return it in date format.
FirstDayDate = DateSerial(TheYear, CurrentMonth, 1)
FirstDay = WeekDay(FirstDayDate, 0)
CurrentDay = FirstDayDate
Response.Write "<TR>"
Response.Write "<td>" & left(CurrentMonthName, 3) & right(CurrentYear, 2) & "</td>"
If FirstDay <> 1 Then
Response.Write "<TD Colspan='" & FirstDay -1 & "' BGCOLOR='lightgreen'>"
End if
DayCounter = FirstDay
CorrectMonth = True
Do While CorrectMonth = True
If CurrentDay = CurrentMonth Then
Response.Write "<TD align='Center' Bgcolor='red'>"
Else
Response.Write "<TD align='Center' BGCOLOR='lightblue'>"
End if
Response.Write Day(CurrentDay) & "</td>"
DayCounter = DayCounter + 1
If DayCounter > 31 then
Response.Write "<TD BGCOLOR='lightgreen'></td>"
Response.Write "</TR><TR>"
End if
CurrentDay = DateAdd("d", 1, CurrentDay)
Week = Week + 1
If Month(CurrentDay) <> CurrentMonth then
CorrectMonth = False
End if
count = count + 1
Loop
Next
%>
</TR>
</TABLE>
thanks
holmags

