ASP Monthly Calendar

liunx

Guest
I want to create a monthly calendar of events where the user selects a year and a month and the calendar shows up in an iframe on the page. I am ok with the entire process but I am looking for suggestions on how to best create the calendar in asp.

I want a single page that will generate the calendar date-by-date for the month based on the year/month query strings so I can populate it with event information from my db.

Thanks!Dim intSelectedMonth
Dim intSelectedYear
Dim intMonthDays
Dim dtmSelectedDate
Dim intMonthStartDay

'Assign date variables
intSelectedMonth = 2
intSelectedYear = 2004

'Get the selected Date
dtmSelectedDate = CDate(intSelectedMonth & "/1/" & intSelectedYear)

'Find out many days are in the month
intMonthDays = DataPart("d",DateAdd("m",1,dtmSelectedDate )
intMonthStartDay = DatePart("w",dtmSelectedDate)

With Response
.Write "<table>"
For i = 1 to 42
If I mod 7 = 0 then
.Write "</tr>" & vbNewLine
.Write "<tr>" & vbNewLine
End If
if i > intMonthStartDay Then
.Write "<td>" & (i-intMonthStartDay) & "</td>"
Else
.Write "<td> </td>"
End If
Next
.Write "</table>"
End With


That should do it for you.... but you might have to adjust to a bit didn't check any of it.Thank you very much. I will apply it and adjust as necessary!check out
<!-- m --><a class="postlink" href="http://www.aspin.com/func/content-search?tree=aspin/tutorial/searchen&id=6207510&rid=&qry=marczewskiThat">http://www.aspin.com/func/content-searc ... zewskiThat</a><!-- m --> one uses a session which is just a bad idea for any load on the server. Not able to be load balanced and many other flaws.

Also the codepage says its US, however the date format does not match dd/mm/yyyy
 
Back
Top