繁体中文
设为首页
加入收藏
当前位置:.Net技术首页 >> Asp.Net开发 >> asp.net下的日历控件源代码

asp.net下的日历控件源代码

2007-04-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:前台ASPx文件 日历控件 ---请选择--- ---请选择--- --> onmouseup="this.className='link_arrow0'" class="link_arrow0" onmousedown="this.className='link_arrow1'" onmouseout="this.className='...

前台ASPx文件

日历控件

---请选择---

---请选择---

-->

onmouseup="this.className='link_arrow0'" class="link_arrow0" onmousedown="this.className='link_arrow1'" onmouseout="this.className='link_arrow0'"

onmouseover="" height="20" width="16">

onmouseout="this.className='link_arrow0'">6

-->

ForeColor="RoyalBlue" BorderWidth="1px" DayNameFormat="FirstLetter" Height="198px" Font-Names="Verdana" BorderColor="#D9D9E6" NextMonthText="下月"

PrevMonthText="上月">

后台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

{

///

/// demoCalendar 的摘要说明。

///

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

override protected void OnInit(EventArgs e)

{

//

// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。

//

InitializeComponent();

base.OnInit(e);

}

///

/// 设计器支持所需的方法 - 不要使用代码编辑器修改

/// 此方法的内容。

///

private void InitializeComponent()

{

this.ddl_Text.TextChanged += new System.EventHandler(this.ddl_Text_TextChanged);

this.Calendar1.VisibleMonthChanged += new System.Web.UI.WebControls.MonthChangedEventHandler(this.Calendar1_VisibleMonthChanged);

this.Calendar1.SelectionChanged += new System.EventHandler(this.Calendar1_SelectionChanged);

this.ImageButton1.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton1_Click);

this.Load += new System.EventHandler(this.Page_Load);

}

#endregion

private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)

{

if(ddl_Text.Text!="")

{

webJSUtil.Alert(this,ddl_Text.Text);

this.ddl_Text.Text="---请选择---";

// webJSUtil.ExecuteClientScriptOnWindowLoad(this,"dropdown(value11)");

}

else

{

webJSUtil.Alert(this,"请选择或输入!");

}

}

private void Calendar1_SelectionChanged(object sender, System.EventArgs e)

{

ddl_Text.Text=Calendar1.SelectedDate.ToShortDateString();

}

private void Calendar1_VisibleMonthChanged(object sender, System.Web.UI.WebControls.MonthChangedEventArgs e)

{

webJSUtil.ExecuteClientScriptOnWindowLoad(this,"dropdown(value11)");

}

private void ddl_Text_TextChanged(object sender, System.EventArgs e)

{

// webJSUtil.Alert(this,this.ddl_Text.Text);

}

}

}

责任编辑:admin
相关文章