zoukankan
html css js c++ java
自定义日期控件
对ASP.Net所知甚少,用
Web Matrix
作了一个日期选择控件,让大家见笑了
控件代码如下:
<%
...
@ Control ClassName
=
"
CustomCalender
"
autoeventwireup
=
"
false
"
Language
=
"
C#
"
targetschema
=
"
http://schemas.microsoft.com/intellisense/ie5
"
%>
<
script
runat
="server"
>
...
private
void
Calendar1_SelectionChanged( System.Object sender, System.EventArgs e )
...
{
TextBox1.Text
=
Calendar2.SelectedDate.ToShortDateString();
Panel1.Visible
=
false
;
}
private
void
OnClick( System.Object sender, System.EventArgs e )
...
{
if
( Panel1.Visible )
...
{
Panel1.Visible
=
false
;
}
else
...
{
Panel1.Visible
=
true
;
}
}
</
script
>
<!--
Insert content here
-->
<
asp:TextBox
id
="TextBox1"
runat
="server"
></
asp:TextBox
>
<
asp:Button
id
="Button1"
onclick
="OnClick"
runat
="server"
size
="43"
Text
="..."
height
="22"
width
="35"
type
="button"
></
asp:Button
>
<
div
id
="divCalendar"
>
<
asp:Panel
id
="Panel1"
runat
="server"
Width
="172px"
Height
="182px"
Visible
="False"
>
<
asp:Calendar
id
="Calendar2"
runat
="server"
Width
="200px"
Height
="180px"
OnSelectionChanged
="Calendar1_SelectionChanged"
BorderWidth
="2px"
BackColor
="White"
ForeColor
="Black"
Font-Size
="8pt"
Font-Names
="Verdana"
BorderColor
="#999999"
BorderStyle
="Outset"
DayNameFormat
="FirstLetter"
CellPadding
="4"
>
<
TodayDayStyle
forecolor
="Black"
backcolor
="#CCCCCC"
></
TodayDayStyle
>
<
SelectorStyle
backcolor
="#CCCCCC"
></
SelectorStyle
>
<
NextPrevStyle
verticalalign
="Bottom"
></
NextPrevStyle
>
<
DayHeaderStyle
font-size
="7pt"
font-bold
="True"
backcolor
="#CCCCCC"
></
DayHeaderStyle
>
<
SelectedDayStyle
font-bold
="True"
forecolor
="White"
backcolor
="#666666"
></
SelectedDayStyle
>
<
TitleStyle
font-bold
="True"
bordercolor
="Black"
backcolor
="#999999"
></
TitleStyle
>
<
WeekendDayStyle
backcolor
="#FFFFCC"
></
WeekendDayStyle
>
<
OtherMonthDayStyle
forecolor
="#808080"
></
OtherMonthDayStyle
>
</
asp:Calendar
>
</
asp:Panel
>
</
div
>
调用页面代码:
<%
...
@ Page Language
=
"
C#
"
%>
<%
...
@ Register TagPrefix
=
"
expo
"
TagName
=
"
CusCalender
"
Src
=
"
NewFile.ascx
"
%>
<
script
runat
="server"
>
...
//
Insert page code here
//
</
script
>
<
html
>
<
head
>
<
title
>
Testing the Calendar
</
title
>
</
head
>
<
body
>
<
form
runat
="server"
>
<
expo:CusCalender
id
="cusCalender"
runat
="server"
></
expo:CusCalender
>
</
form
>
</
body
>
</
html
>
查看全文
相关阅读:
Windows server 2008 R2远程桌面终端连接数的破解
VirtualBox是什么
蓝屏代码和解决办法
最新版都叫兽数据恢复软件和注册机
两种颜色混合
[译]GLUT教程
OpenGl的glMatrixMode()函数理解
OpenGL ES 画直线代码实例
7天学习opengl入门
error C2275 将此类型用作表达式非法
原文地址:https://www.cnblogs.com/dahuzizyd/p/20119.html
最新文章
多启动引导工具——AIO Boot
mysql数据库的基本操作(列类型、类属性)
mysql数据库的基本操作(增删改查、字符集、校对集)
把select结果update更新到表中,从查询结果中更新数据
Centos7 调整磁盘空间
连接greenplum(postgresql)数据库报错:no pg_hba.conf entry for host,以及重启 greenplum
扩展vmware centos虚拟机的根目录磁盘空间
SQL Management Studio导出表为 txt,两条记录变成一行
使用 TXTkiller.exe 拆分大txt文件成多个txt文件
批量将.txt编码格式转化为utf8
热门文章
详解SQL Server导出表为csv或txt,postgresql导入csv或txt
Android开发之Source无法覆写public void onClick(View v)
代码着色
新浪博客如何显示高亮代码,DIY
Linux系统挂载ntfs分区
centOS 6.4下安装中文输入法
Linux下yum安装MPlayer 或 LVC视频播放器
二级路由器设置为何要关闭DHCP服务
vsftp配置参数
virtual box 中两个虚拟机 、宿主机 三机互通并且能上外网设置
Copyright © 2011-2022 走看看