ASP.NET通过代码给TextBox添加事件(点击显示日历)

private void BindDate()
{
tbApplyStartDate.Attributes.Add("onclick", "new Calendar().show(this)");
tbApplyEndTime.Attributes.Add("onclick", "new Calendar().show(this)");
tbOfficialStartTime.Attributes.Add("onclick", "new Calendar().show(this)");
tbOfficialEndTime.Attributes.Add("onclick", "new Calendar().show(this)");
tbRealEndTime.Attributes.Add("onclick", "new Calendar().show(this)");
tbCheckTime_zdb.Attributes.Add("onclick", "new Calendar().show(this)");
tbCheckTime_zjb.Attributes.Add("onclick", "new Calendar().show(this)");
tbApplyStartDate.ReadOnly = true;
tbApplyEndTime.ReadOnly = true;
tbOfficialStartTime.ReadOnly = true;
tbOfficialEndTime.ReadOnly = true;
tbRealEndTime.ReadOnly = true;
tbCheckTime_zdb.ReadOnly = true;
tbCheckTime_zjb.ReadOnly = true;
}

 

这个实例代码是给TextBox添加日历效果的

posted @ 2013-06-17 09:59  stevejson  阅读(1158)  评论(0编辑  收藏  举报