All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
HTML语言剖析(四)排版标记_[Html教程]
胡思乱想胡言乱语ASP.NET,AJAX_[Asp.Net教程]
Asp.net中的页面乱码的问题_[Asp.Net教程]
SQL,Server为何走上虚拟化之路?_mssql学习_编程技术
简单示例:AJAX结合PHP代码实现登录_[PHP教程]
PHP界的大事:zend已经可以破解_[PHP教程]
FCKEditor在Asp.net的安装_[Asp.Net教程]
Asp.net,MVC中页面标题的解决方法_[Asp.Net教程]
PHP中session详解_[PHP教程]
C#中对象概念和应用实例
Reading number is top 10 pictures
看到这名字我也是醉了。。。。。。
The little woman's bright wire2
The money of more than 100 countries and regions21
The real super beauty2
NeedWallpaper11
China telecom 114 spokesman MeiYanXu1
The Soviet union swimsuit exposure in the 70 year2
Japan sexy beauty passion photo
真正的国产-非模拍 贵在是真实2
Ashlynn Brooke show proud chest measurement3
Download software ranking
Boxer Classic video3
Take off clothes to survival
Professional killers2 for Android
Eclipse 4.2.1 For Win32
Unix video tutorial12
The Bermuda triangle1
打鸟视频
圣殿祭司的ASP.NET.2.0.开发详解-使用C#
Unix video tutorial8
Tram sex maniac 2 (H) rar bag6
delv published in(发表于) 2014/1/24 9:04:16 Edit(编辑)
asp.net2.0里用Calendar控件做带节日提示的日历_[Asp.Net教程]

asp.net2.0里用Calendar控件做带节日提示的日历_[Asp.Net教程]

asp.net2.0里用Calendar控件做带节日提示的日历_[Asp.Net教程]

1、建立网页CalendarThree.aspx,代码如下:


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CalendarThree.aspx.cs" Inherits="CalendarThree" %>





无标题页













2、CalendarThree.aspx.cs代码如下:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class CalendarThree : System.Web.UI.Page
{
String[][] holidays = new String[13][];
protected void Page_Load(object sender, EventArgs e)
{
for (int n = 0; n < 13; n++)
holidays[n] = new String[32];

holidays[1][1] = "元旦";
holidays[2][14] = "情人节";
holidays[3][8] = "妇女节";
holidays[3][12] = "植树节";
holidays[4][1] = "愚人节";
holidays[5][1] = "劳动节";
holidays[5][4] = "青年节";
holidays[5][12] = "护士节";
holidays[5][14] = "母亲节";
holidays[5][14] = "助残日";
holidays[6][1] = "国际儿童节";
holidays[6][5] = "环境保护日";
holidays[6][18] = "父亲节";
holidays[6][26] = "国际禁毒日";
holidays[7][1] = "****诞辰";
holidays[8][1] = "建军节";
holidays[9][10] = "教师节";
holidays[10][1] = "国庆节";
holidays[11][23] = "感恩节";
holidays[12][1] = "艾滋病日";
holidays[12][12] = "西安事变";
holidays[12][25] = "圣诞节";
}
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
CalendarDay d = ((DayRenderEventArgs)e).Day;
TableCell c = ((DayRenderEventArgs)e).Cell;

if (e.Day.IsOtherMonth)
{
e.Cell.Controls.Clear();
}
else
{
try
{
string Hol = holidays[e.Day.Date.Month][e.Day.Date.Day];

if (Hol != string.Empty)
e.Cell.Controls.Add(new LiteralControl("
" + Hol + ""));
}
catch (Exception exc)
{
Response.Write(exc.ToString());
}
}
}
}


3、运行的效果如下:


来源:csdn







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.