您的位置:首页 > 编程语言 > ASP

ASP.NET AJAX控件之PopupControl(日历控件)

2008-06-13 17:33 609 查看
aspx:
<title>AJAX控件之PopupControl</title>
</head>
<body style="text-align: center">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div style="text-align: center">
日历:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
<asp:Panel ID="Panel1" runat="server" Height="184px" Width="171px">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999"
CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="Black" Height="180px" OnSelectionChanged="Calendar1_SelectionChanged"
Width="200px">
<SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#FFFFCC" />
<OtherMonthDayStyle ForeColor="#808080" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
</asp:Calendar>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<br />
<cc1:PopupControlExtender ID="PopupControlExtender1" runat="server" PopupControlID="Panel1"
Position="Bottom" TargetControlID="TextBox1">
</cc1:PopupControlExtender>
</div>
</form>
</body>
</html>
cs:
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
PopupControlExtender1.Commit(Calendar1.SelectedDate.ToShortDateString());
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: