转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 站长学院 >> Web开发 >> 正文
[原创]asp.net下的日历控件源代码         ★★★★

[原创]asp.net下的日历控件源代码

作者:闵涛 文章来源:闵涛的学习笔记 点击数:2275 更新时间:2009/4/23 10:43:21

前台aspx文件
<%@ Register TagPrefix="componentart" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
<%@ Page language="c#" Codebehind="demoCalendar.aspx.cs" AutoEventWireup="false" Inherits="orderMRP.demo.Calendar.demoCalendar" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
 <HEAD>
  <title>日历控件</title>
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  <script>
var dropShow=false
var currentID
function dropdown(el){
if(dropShow){
dropFadeOut()
}else{
currentID=el
el.style.visibility="visible"
dropFadeIn()
}
}
function dropFadeIn(){
if(currentID.filters.alpha.opacity<100){
currentID.filters.alpha.opacity+=20
fadeTimer=setTimeout("dropFadeIn()",50)
}else{
dropShow=true
clearTimeout(fadeTimer)
}
document.all.ddl_Text.innerText="";
}
function dropFadeOut(){
if(currentID.filters.alpha.opacity>0){
clearTimeout(fadeTimer)
currentID.filters.alpha.opacity-=20
fadeTimer=setTimeout("dropFadeOut()",50)
}else{
dropShow=false
currentID.style.visibility="hidden"
}
}
function dropdownHide(){
if(dropShow){
dropFadeOut()
dropShow=false
}
}

/*
function hiLight(el)
{
if(dropShow)
  {
    for(i=0;i<el.parentElement.childNodes.length;i++)
    {
      el.parentElement.childNodes(i).className="link_record0"
    }
      el.className="link_record1"
   }
}
//function CheckMe(el){
//document.all.ddl_Text.innerText=el.innerText
//}
*/
document.onclick=dropdownHide
  </script>
  <LINK href="DDLControl.css" type="text/css" rel="stylesheet">
 </HEAD>
 <body bgColor="#e6e7ed" onload="document.all.Form1.reset()">
  <form id="Form1" runat="server">
   <table id="Table20">
    <tr>
     <td>
      <div class="link_box" onselectstart="return false" style="WIDTH: 100px">
       <div class="link_head">
        <table id="Table30" height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
         <tr>
          <td>
           <div class="link_text"><nobr><asp:textbox id="ddl_Text" runat="server" Width="97px" Font-Size="9pt" BorderStyle="Groove">---请选择---</asp:textbox><!--onkeyup="dropdown(value11)" onchange="window.alert(''''vv'''')"-->
             <!--
                <label id="ddl_Text">---请选择---</label>
                <input id="ddl_Text" type="text" value="---请选择---" name="ddl_Text">
                --></nobr></div>
          </td>
          <td align="right" width="22"><IMG alt="" src="../../images/other/BIMG.gif" onLoad="this.style.cursor=''''hand''''" onclick="dropdown(value11)"
            onmouseup="this.className=''''link_arrow0''''" class="link_arrow0" onmousedown="this.className=''''link_arrow1''''" onmouseout="this.className=''''link_arrow0''''"
            onmouseover="" height="20" width="16">
           <!--
          <div onmouseup="this.className=''''link_arrow0''''" class="link_arrow0" onmousedown="this.className=''''link_arrow1''''"
            onmouseout="this.className=''''link_arrow0''''">6</div>
          -->
          </td>
         </tr>
        </table>
       </div>
       <div class="link_value" id="value11" style="WIDTH: 200px; HEIGHT: 200px">
        <table id="Table40" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
         <tr>
          <td align="center" bgColor="#ffffff" height="30"><asp:Calendar id="Calendar1" runat="server" Font-Size="5pt" Width="198px" BackColor="White" CellPadding="1"
            ForeColor="RoyalBlue" BorderWidth="1px" DayNameFormat="FirstLetter" Height="198px" Font-Names="Verdana" BorderColor="#D9D9E6" NextMonthText="下月"
            PrevMonthText="上月">
            <TodayDayStyle ForeColor="White" BackColor="#99CCCC"></TodayDayStyle>
            <SelectorStyle ForeColor="#336666" BackColor="#99CCCC"></SelectorStyle>
            <NextPrevStyle Font-Size="8pt" ForeColor="Snow"></NextPrevStyle>
            <DayHeaderStyle Height="1px" ForeColor="#336666" BackColor="#99CCCC"></DayHeaderStyle>
            <SelectedDayStyle Font-Bold="True" ForeColor="#CCFF99" BackColor="#009999"></SelectedDayStyle>
            <TitleStyle Font-Size="7pt" Font-Bold="True" Height="25px" BorderWidth="1px" ForeColor="White"
             BorderStyle="Solid" BorderColor="#D9D9E6" BackColor="#6699CC"></TitleStyle>
            <WeekendDayStyle BackColor="#CCCCFF"></WeekendDayStyle>
            <OtherMonthDayStyle ForeColor="#999999"></OtherMonthDayStyle>
           </asp:Calendar></td>
         </tr>
        </table>
       </div>
      </div>
     </td>
     <td><asp:imagebutton id="ImageButton1" runat="server" ImageUrl="~/images/loginImg/login_ok.gif"></asp:imagebutton></td>
    </tr>
   </table>
   <P>&nbsp;</P>
   <P><FONT face="宋体"></FONT>&nbsp;</P>
   <P><FONT face="宋体"></FONT>&nbsp;</P>
   <P><FONT face="宋体"></FONT>&nbsp;</P>
   <P><FONT face="宋体"></FONT>&nbsp;</P>
   <P><FONT face="宋体"></FONT>&nbsp;</P>
   <P>&nbsp;</P>
  </form>
 </body>
</HTML>

后台cs文件
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

using NickLee.Web.UI;

namespace orderMRP.demo.Calendar
{
 /// <summary>
 /// demoCalendar 的摘要说明。
 /// </summary>
 public class demoCalendar : System.Web.UI.Page
 {
  private NickLee.Web.UI.encryption en1=new encryption();
  private webDataFill Fill=new webDataFill();

  protected System.Web.UI.WebControls.ImageButton ImageButton1;
  protected System.Web.UI.WebControls.TextBox ddl_Text;
  protected System.Web.UI.WebControls.Button Button1;
  protected System.Web.UI.WebControls.Calendar Calendar1;
 
  private void Page_Load(object sender, System.EventArgs e)
  {
   Fill.ConString=System.Configuration.ConfigurationSettings.AppSettings["SqlConnectionString"];
 
  }

  #region Web Form Designer generated code

[1] [2]  下一页


[C语言系列]NET 中C#的switch语句的语法  [系统软件]托拽Explore中的文件到VB.net的窗口
[系统软件]Boost库在XP+Visual C++.net中的安装  [常用软件]新配色面板:Paint.Net3.0RC1官方下载
[常用软件]用内建的“Net Meeting”聊天  [VB.NET程序]Henry的VB.NET之旅(三)—共享成员
[VB.NET程序]Henry的VB.NET之旅(二)—构造与析构  [VB.NET程序]Henry的VB.NET之旅(一)—失踪的窗体
[VB.NET程序]在托盘上显示Balloon Tooltip(VB.NET)  [VB.NET程序]Henry手记-VB.NET中动态加载Treeview节点(二)
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · Web开发  · 网页制作
    · 平面设计  · 网站运营
    · 网站推广  · 搜索优化
    · 建站心得  · 站长故事
    · 互联动态
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台