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
>
查看全文
相关阅读:
FineBI与power BI,一个是国外风生水起的微软巨头,一个是方兴未艾的国产BI厂商领导者
Linux下的crontab定时执行任务命令详解举例
手把手教你搭建SSH框架(Eclipse版)
一、连接池的定义
centos安装sftp服务win搭建 sftp 服务器
前往阿里云的企业优惠活动页面
世界可能是思想最为混乱的时候,无论你说什么
python面向对象编程class1
Python 文件I/O 文件读写模式r,r+,w,w+,a,a+的区别
Python中的装饰器是你进入Python大门的一道坎,不管你跨不跨过去它都在那里
原文地址:https://www.cnblogs.com/dahuzizyd/p/20119.html
最新文章
检测到时钟错误。您的创建可能是不完整的
selector函数指针回调机制
Android开源库集锦
vi 常用命令行
(转)HttpClient 模拟登陆,保持会话并进行后续操作
(转载)Linux入门:操作目录和文件的命令
Lua学习笔记
(转载)使用curl 和 libjson 完成联网和数据解析
wireshark 使用
JNI c++ 调用 java
热门文章
Java date format 时间格式化
javascript验证日期的有效性,两个日期的大小比较
PCA&ZCA白化
马氏距离(Mahalanobis Distence) [python]
[补坑python连接mysql] 使用MySQLdb报错... (2006, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)")localhost连接
[算法]组合/子集问题(包含POJ2453) 从n个元素的集合中选择k个元素作为子集的所有情况(python实现)
[Linux] C语言 系统编程(文件操作+进程相关)
[Docker] docker的使用和远程连接
[复习整理] (一)二叉树遍历
[寒假学习笔记](一)Markdown语法学习
Copyright © 2011-2022 走看看