编程教程
你的位置: 中国个人站长站 -- 网络编程 -- ASP教程 -- 教程正文 日历源程序
推荐位

日历源程序

中国个人站长站 ASP教程 点击数: 更新时间:2007-8-26 9:56:35
're displaying calendar for
Dim iDIM      ' Days In Month
Dim iDOW      ' Day Of Week that month starts on
Dim iCurrent  ' Variable we use to hold current day of month as we write table
Dim iPosition ' Variable we use to hold current position in table


' Get selected date.  There are two ways to do this.
' First check if we were passed a full date in RQS("date").
' If so use it, if not look for seperate variables, putting them togeter into a date.
' Lastly check if the date is valid...if not use today
If IsDate(Request.QueryString("date")) Then
dDate = CDate(Request.QueryString("date"))
Else
If IsDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" &
Request.QueryString("year")) Then
dDate = CDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-"
& Request.QueryString("year"))
Else
dDate = Date()
' The annoyingly bad solution for those of you running IIS3
If Len(Request.QueryString("month")) <> 0 Or Len(Request.QueryString("day")) <> 0 Or
Len(Request.QueryString("year")) <> 0 Or Len(Request.QueryString("date")) <> 0 Then
Response.Write "The date you picked was not a valid date.  The calendar
was set to today's date.<BR><BR>"
End If
' The elegant solution for those of you running IIS4
'If Request.QueryString.Count <> 0 Then Response.Write "The date you picked was not
a valid date.  The calendar was set to today's date.<BR><BR>"
End If
End If

'Now we've got the date.  Now get Days in the choosen month and the day of the week it starts on.
iDIM = GetDaysInMonth(Month(dDate), Year(dDate))
iDOW = GetWeekdayMonthStartsOn(dDate)

%>
<!-- Outer Table is simply to get the pretty border-->
<TABLE BORDER=10 CELLSPACING=0 CELLPADDING=0>
<TR>
<TD>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 BGCOLOR=#99CCFF>
<TR>
<TD BGCOLOR=#000099 ALIGN="center" COLSPAN=7>
<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR>
<TD ALIGN="right"><A HREF="./calendar.asp?date=<%=
SubtractOneMonth(dDate) %>"><FONT COLOR=#FFFF00 SIZE="-1">&lt;&lt;</FONT></A></TD>
<TD ALIGN="center"><FONT COLOR=#FFFF00><B><%=
MonthName(Month(dDate)) &a

上一页  [1] [2] [3] [4] [5] 下一页

教程录入:swh    责任编辑:swh 
个人站长站与你风雨同舟!
本站所提供的资源均来源于互联网,如有侵权行为,请与本站管理员联系,我们会第一时间删除!
·如果您发现《日历源程序》文章有错误,也请通知我们修改!
联系邮箱chinageren#126.com,谢谢支持!
站内搜索:
广告服务 | 友情链接 | 联系我们 | 免责声明 | 用户留言 | 网站导航
版权所有:中国个人站长站 2007-2008 未经授权禁止复制或建立镜像 客服QQ号:112731235
copyright © 2007-2008 www.ChinaGeRen.com online services. all rights reserved. 苏ICP备05000059号