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
>
查看全文
相关阅读:
Java.util.concurrent包学习(一) BlockingQueue接口
[转载]最牛B的编码套路
思考人生
非奇异矩阵的零度互补法则
Hopfield 网络(下)
Hopfield 网络(上)
矩阵的相似性与对角化
左右特征向量
特征多项式、代数重数与几何重数
特征值和特征向量
原文地址:https://www.cnblogs.com/dahuzizyd/p/20119.html
最新文章
cv2.cornerHarris()详解 python+OpenCV 中的 Harris 角点检测
手指静脉细化算法过程原理解析 以及python实现细化算法
python遍历文件 python创建XML对象 方法 python解析XML文件 提取ROI坐标计存入文件
VS下如何建立一个新的MFC程序 网络编程 课设 基于C++ MFC 连接数据库 小应用 小项目浅析展示
新手 php连接数据库大概。简单过程浅析以及遇到的问题分析
mysql安装 2019最新安装mysql教程及遇到的问题解决Windows下
Ajax中的JSON格式与php传输过程的浅析
用js(JavaScript-jQuery)解析XML文件 无法成功 获得XML对象,字符串一些心得
Python全栈开发,Day3
Python全栈开发,Day2
热门文章
Python全栈开发,Day1
网络连接详细信息出现两个自动配置ipv4地址
windows自带记事本导致文本文件(UTF-8编码)开头三个字符乱码问题
WindowsError的错误代码详解
实现python中的map函数
VMware Tools的简易安装---解决Ubuntu 14.10不能满屏显示问题
为什么要使用Hibernate
What is the difference between extensibility and scalability?
[转载]WEB缓存技术概述
Windows BAT文件使用技巧[转载]
Copyright © 2011-2022 走看看