-1

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.

How can I do that?

J. Steen
  • 15,470
  • 15
  • 56
  • 63
Umair Javed
  • 1
  • 1
  • 4

1 Answers1

0

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

Ruchi
  • 1,238
  • 11
  • 32