<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.NewFolder1.WebForm1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="asm" runat="server" /> <div>
Departure date: <asp:TextBox ID="tbDeparture" runat="server" />
Day : <asp:TextBox ID="tbDay" runat="server"></asp:TextBox>
Time : <asp:TextBox ID="tbTime" runat="server"></asp:TextBox>
Return date: <asp:TextBox ID="tbReturn" runat="server" />
</div> <asp:Panel ID="pnlCalendar" runat="server">
<asp:UpdatePanel ID="up1" runat="server">
<ContentTemplate>
<asp:Calendar ID="c1" runat="server"
OnSelectionChanged="c1_SelectionChanged" />
</ContentTemplate>
</asp:UpdatePanel> </asp:Panel>
<cc1:PopupControlExtender ID="pce1" runat="server" TargetControlID="tbDeparture" PopupControlID="pnlCalendar"
Position="Bottom" />
<cc1:PopupControlExtender ID="pce2" runat="server" TargetControlID="tbReturn" PopupControlID="pnlCalendar" Position="Bottom" />
</div>
</form>
</body>
</html>
C# code
protected void c1_SelectionChanged(object sender, EventArgs e)
{
AjaxControlToolkit.PopupControlExtender pce = AjaxControlToolkit.PopupControlExtender.GetProxyForCurrentPopup(Page);
pce.Commit((sender as Calendar).SelectedDate.ToShortDateString());
//pce.Commit((sender as Calendar).SelectedDate.ToShortDateString());
}
After click the tbDeparture textbox ,I want to set value on tbDeparture ,tbDayand ,tbTime textbox .Suppose you click Today date on Calendar then tbDeparture=29-Dec-09 ,tbDayand =Sun Day ,tbTime =CUrrnt time.Click on calendar and value set on three textbox.