给你写了一个。
前台
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="use.aspx.cs" Inherits="use" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Calendar</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>
<asp:TextBox ID="TextBoxDate" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="..." />
</td>
</tr>
<tr>
<td>
<asp:Panel ID="PanelCalendar" runat="server" Visible="true">
<asp:Calendar ID="Calendar1" runat="server" OnSelectionChanged="Calendar1_SelectionChanged">
</asp:Calendar>
</asp:Panel>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
后台using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class use : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ } public string Text
{
get
{
return this.TextBoxDate.Text;
}
set
{
this.TextBoxDate.Text = value; }
}
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
TextBoxDate.Text = Calendar1.SelectedDate.ToShortDateString();
}
}
前台
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="use.aspx.cs" Inherits="use" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Calendar</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>
<asp:TextBox ID="TextBoxDate" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="..." />
</td>
</tr>
<tr>
<td>
<asp:Panel ID="PanelCalendar" runat="server" Visible="true">
<asp:Calendar ID="Calendar1" runat="server" OnSelectionChanged="Calendar1_SelectionChanged">
</asp:Calendar>
</asp:Panel>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
后台using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class use : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ } public string Text
{
get
{
return this.TextBoxDate.Text;
}
set
{
this.TextBoxDate.Text = value; }
}
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
TextBoxDate.Text = Calendar1.SelectedDate.ToShortDateString();
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货