快精灵印艺坊 您身边的文印专家
广州名片 深圳名片 会员卡 贵宾卡 印刷 设计教程
产品展示 在线订购 会员中心 产品模板 设计指南 在线编辑
 首页 名片设计   CorelDRAW   Illustrator   AuotoCAD   Painter   其他软件   Photoshop   Fireworks   Flash  

 » 彩色名片
 » PVC卡
 » 彩色磁性卡
 » 彩页/画册
 » 个性印务
 » 彩色不干胶
 » 明信片
   » 明信片
   » 彩色书签
   » 门挂
 » 其他产品与服务
   » 创业锦囊
   » 办公用品
     » 信封、信纸
     » 便签纸、斜面纸砖
     » 无碳复印纸
   » 海报
   » 大篇幅印刷
     » KT板
     » 海报
     » 横幅

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

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
size=-2><--Previous</a>
&nbsp;&nbsp;&nbsp;
<a href="DateSelect.asp?BMonth=<%=NextMonth%>"><font size=-2>Next--></a>


<hr></td>
</tr>
<tr>
<td><font size="-3">Su</td><td><font size="-3">Mo</td><td><font
size="-3">Tu</td><td><font size="-3">We</td><td><font
size="-3">Th</td><td><font size="-3">Fr</td><td><font size="-3">Sa</td>
</tr>
<tr>

<tr>
<%
DayPosition=1
\\\'Now loop through table build with blanks until first day of month
\\\'is in position
For I = 1 to BuildDayValue-1

%>
<td><font size="-3">&nbsp;</td>
<%
DayPosition=DayPosition+1
Next

Do Until CurrentMonth <> Month(BuildDate)
%>

<%
While DayPosition<>8
%>
<td align="center" <%If Day(BuildDate)=Day(Now) Then Response.Write "bgcolor=""#FFFFFF"""%>
onClick="<%Response.Write "calpopulate(\\\'" & Month(BuildDate) & "/" & Day(BuildDate) & "/" & Right(Year
(BuildDate),2)%>\\\')"><font size="-3">

<a href=""><%=Day(BuildDate)%></a>
</td>
<%
DayPosition=DayPosition+1
BuildDate=DateAdd("d", 1, BuildDate)
If CurrentMonth <> Month(BuildDate) then
DayPosition=8
End If
Wend
DayPosition=1
%>

</tr><tr>
<%
Loop
%>
</tr>
</table>
</center>
</BODY>
</HTML>
返回类别: 教程
上一教程: ASP 3.0高级编程(十九)
下一教程: XMLHTTP GET HTML页面时的中文乱码之完全客户端SCRIPT解决方案

您可以阅读与"一个提供用户输入时期的绝好程序之(二)"相关的教程:
· 一个提供用户输入时期的绝好程序之(一)
· 利用PAGE.ISPOSTBACK属性保持用户输入的FRAMEWORK
· 在ASP中过滤用户输入 提高安全性
· 综合的判定用户输入的合法性的函数
· ASP程序中同一个用户不答应同时登陆两次
    微笑服务 优质保证 索取样品