您现在的位置:计算机技术学习网 > 技术中心 > WEB编程 > ASP >

一个提供用户输入时期的绝好程序之(二)

来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 12:55 点击:
DateSelect.asp 创立一个日历格式的。。。

<%@ LANGUAGE="VBSCRIPT" %>
<%
Code Written by D. Scott Hand
If any errors are found, please
e-mail scott_hand@pobox.com with
the error and the way the error
was caused
***Purpose:************
* This is a page built to show calendar functionality.
* Description:
* This is the instantiated file toto
* allow the user to select a date.
***********************
If Request.Querystring("Page") <> "" Then
   PageName = Request.Querystring("Page")
   Session("PageName") = PageName
Else
   PageName = Session("PageName")
End If
If Request.Querystring("Form") <> "" Then
   FormName = Request.Querystring("Form")
   Session("FormName") = FormName
Else
   FormName = Session("FormName")
End If
If Request.Querystring("Element") <> "" Then
   ElementName = Request.Querystring("Element")
   Session("ElementName") = ElementName
Else
   ElementName = Session("ElementName")
End If
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Select Date</TITLE>
</HEAD>
<BODY BGColor="#ded6c5" alink="#526B84" vlink="#526B84" onBlur="javascript:self . focus ();">
<SCRIPT LANGUAGE="javascript">
   function calpopulate(dte) {
   window.opener.<%=formname & "." & elementname%>.value = dte;
   self.close()
      }
</SCRIPT>
<%
If IsDate(Request.QueryString("Date")) Then
BuildDate=Request.QueryString("Date")
Else

If Request.Querystring("BMonth") = "" Then
BMonth = Month(Now)
Else
BMonth = Request.Querystring("BMonth")
End If

If Request.QueryString("BYear") <> "" Then
BuildDate = BMonth & "/" & "1" & "/" & _
       Request.QueryString("BYear")
Else
BuildDate = BMonth & "/" & "1" & "/" & Right(Year(Now), 2)
End If

End If
Session("CurrentDate")=BuildDate

This gives the position of weekday for that date
BuildDayValue = Weekday(BuildDate)


CurrentMonth = Month(BuildDate)
%>
<center>
<table>
<tr>
<td colspan="7" align="center">
<hr>
<font size=2><b><%=MonthName(CurrentMonth)%>&nbsp;<%=Year(BuildDate)%></b>
<br>

<%
BuildDate=DateAdd("d", -1, BuildDate)
If CurrentMonth < 12 then
NextMonth=CurrentMonth+1 & "&BYear=" & Year(BuildDate)
Else
NextMonth="1&BYear=" & Year(DateAdd ("yyyy", 1, BuildDate))
End if

If CurrentMonth > 1 then
PreviousMonth=CurrentMonth-1 & "&BYear=" & Year(BuildDate)
Else
PreviousMonth= "12&BYear=" & Year(DateAdd ("yyyy", -1, BuildDate))
End If
%>
<a href="DateSelect.asp?BMonth=<%=PreviousMonth%>"><font

    相关新闻>>

      发表评论
      请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
      用户名: 验证码:点击我更换图片
      最新评论 更多>>

      推荐热点

      • WAP常见问题问答大全(四)
      • ASP开发必备:WEB打印代码大全
      • ASP调用系统ping命令
      • asp缓存技术
      • ASP教程:第三篇 ASP基础
      • 用ASP+XML打造留言本(4)
      • 关于ASP Recordset 分页出现负数解决方法及建议
      • 用asp怎样编写文档搜索页面(5)
      • ASP处理多关键词查询实例代码
      网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
      Copyright © 2008-2015 计算机技术学习交流网. 版权所有

      豫ICP备11007008号-1