我在我所用阿贾克斯日历扩展两个文本框。当我选择的文本框中的一个日期,它会自动加入一些几天或几个月填补其他文本框。
I have two textboxes in which I have used ajax calendar extender. When I choose a date from one of the text boxes, it should automatically fill the other textbox by adding some days or months.
我怎么能这样做?
请遵循这个例子和修改code。希望它能帮助。
Please follow this example and modify your code. Hope it helps.
<asp:UpdatePanel id="UpdatePanel1" runat="server">
<contenttemplate>
<cc2:CalendarPopup id="CalendarExtender1" runat="server" Width="71px" OnDateChanged="CalendarPopup1_DateChanged" AutoPostBack="True"></cc2:CalendarPopup>
<cc2:CalendarPopup id="CalendarExtender2" runat="server" Width="71px"></cc2:CalendarPopup>
</contenttemplate>
</asp:UpdatePanel>
**Code behind:**
protected void CalendarPopup1_DateChanged(object sender, EventArgs e)
{
CalendarPopup2.SelectedDate = CalendarPopup1.SelectedDate.AddDays(1); // you can add the number of days you want
}
另外,下面的链接可能给你关于这个主题更好地了解:
Also the following link might give you better insight on this topic:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=149
上一篇:什么是正确的方式来使用的OnPaint在.Net应用程序?应用程序、正确、方式、OnPaint
下一篇:的SqlCeConnection的连接字符串相对路径出现故障字符串、路径、出现故障、SqlCeConnection