asp 语法教程(五)asp 的服务器端编程控件篇(2)
2008-02-23 05:37:44来源:互联网 阅读 ()
output.WriteLine("<script language=jscript>drawcalendar('" UniqueID "', '" Int32.Format(currentDate.Year, null) "/" Int32.Format(currentDate.Month, null) "/" Int32.Format(currentDate.Day, null) "');</script>");
}
protected override void PreRender()
{
String DHTMLFunction = "";
DHTMLFunction = "<script language='JavaScript'> \n";
DHTMLFunction = " function drawcalendar(calname, newDate) \n";
DHTMLFunction = " { \n";
DHTMLFunction = " var CurrentDate = new Date(newDate);\n";
DHTMLFunction = " var MonthArray = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');\n";
DHTMLFunction = " var MonthDays = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);\n";
DHTMLFunction = " var calText;\n";
DHTMLFunction = " calText = '<table bgcolor=#dcdcdc border=0 height=190 valign=top>';\n";
DHTMLFunction = " calText = calText '<tr><td>';\n";
DHTMLFunction = " calText = calText '<center>';\n";
DHTMLFunction = " calText = calText \"<a href='javascript:drawcalendar(\\\"\" calname \"\\\", \\\"\" CurrentDate.getFullYear() \"/\" CurrentDate.getMonth() \"/\" CurrentDate.getDate() \"\\\")'>\";\n";
DHTMLFunction = " calText = calText '<img src=/quickstart/aspplus/images/left4.gif width=11 height=11 border=0></a>';\n";
DHTMLFunction = " calText = calText ' <b>' MonthArray[CurrentDate.getMonth()] ' ' CurrentDate.getFullYear() '</b>';\n";
DHTMLFunction = " calText = calText \" <a href='javascript:drawcalendar(\\\"\" calname \"\\\", \\\"\" CurrentDate.getFullYear() \"/\" (CurrentDate.getMonth() 2) \"/\" CurrentDate.getDate() \"\\\")'>\";\n";
DHTMLFunction = " calText = calText '<IMG SRC=/quickstart/aspplus/images/right4.gif width=11 height=11 border=0></a>';\n";
DHTMLFunction = " calText = calText '</center>';\n";
DHTMLFunction = " calText = calText '</td></tr>';\n";
DHTMLFunction = " calText = calText '<tr valign=top><td valign=top>';\n";
DHTMLFunction = " calText = calText '<table border=1 bgcolor=#eeeeee height=160>';\n";
DHTMLFunction = " calText = calText '<tr height=20>';\n";
DHTMLFunction = " calText = calText ' <td align=right width=23> Sun </td>';\n";
DHTMLFunction = " calText = calText ' <td align=right width=23> Mon </td>';\n";
DHTMLFunction = " calText = calText ' <td align=right width=23> Tue </td>';\n";
DHTMLFunction = " calText = calText ' <td align=right width=23> Wed </td>';\n";
DHTMLFunction = " calText = calText ' <td align=right width=23> Thu </td>';\n";
DHTMLFunction = " calText = calText ' <td align=right width=23> Fri </td>';\n";
DHTMLFunction = " calText = calText ' <td align=right width=23> Sat </td>';\n";
DHTMLFunction = " calText = calText '</tr>';\n";
DHTMLFunction = " calText = calText '<tr>';\n";
DHTMLFunction = " var numDays = MonthDays[CurrentDate.getMonth()];\n";
DHTMLFunction = " var firstDay = new Date(1999, 8, 1).getDay();\n";
DHTMLFunction = " for (var x=0; x<firstDay; x )\n";
DHTMLFunction = " {\n";
DHTMLFunction = " calText = calText '<td align=right width=23></td>'\n";
DHTMLFunction = " }\n";
DHTMLFunction = " for (var x=1; x<=numDays; x ) \n";
DHTMLFunction = " { \n";
DHTMLFunction = " if (CurrentDate.getDate() == x) \n";
DHTMLFunction = " { \n";
DHTMLFunction = " calText = calText '<td align=right width=23>';\n";
DHTMLFunction = " calText = calText '<font color=red><b><u>' x '</u></b></font>';\n";
DHTMLFunction = " calText = calText '</td>';\n";
DHTMLFunction = " }\n";
DHTMLFunction = " else \n";
DHTMLFunction = " { \n";
DHTMLFunction = " calText = calText '<td align=right width=23>';\n";
DHTMLFunction = " calText = calText \"<a href='javascript:drawcalendar(\\\"\" calname \"\\\", \\\"\" CurrentDate.getFullYear() \"/\" (CurrentDate.getMonth() 1) \"/\" x \"\\\")'>\" x \"</a>\";";
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash
