// aspx code:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Test calendar and atlas</title>
<atlas:ScriptManager ID="sm1" runat="server" EnablePartialRendering="true"></atlas:ScriptManager>
</head>
<body>
<form id="form1" runat="server">
<div>
Choose a date:<br/>
<!--
I need 3 panels related to the calendar:
- one that updates the textbox on event SelectionChanged without refreshing the whole page
- one that shows the calendar picker (at the click of ShowCalendarPicker linkbutton)
- one that hides the calendar picker (at the click of HideCalendarPicker linkbutton)
-->
<!-- when a new date is chosen, update the textbox without refreshing the whole page -->
<atlas:UpdatePanel ID="up1" runat="server">
<Triggers>
<atlas:ControlEventTrigger ControlID="cldCalendar" EventName="SelectionChanged" />
</Triggers>
<ContentTemplate>
<!-- this displayes the currently selected date -->
<asp:TextBox runat="server" ID="txtChoosenDate" Text=""/>
</ContentTemplate>
</atlas:UpdatePanel>
<!-- this opens the calendar popup. What is actually displayed = the calendar + a linkbutton to hide it -->
<asp:imagebutton runat="server" id="btnShowCalendarPicker" onclick="ShowCalendarPicker_Click" imageurl="~/images/smoking.jpg" height="20px" width="20px" />
<!-- the calendar picker and the button to hide it after date was picked are hold together in a panel to be displayed/hidden together at the same time -->
<atlas:UpdatePanel ID="up2" runat="server">
<Triggers>
<atlas:ControlEventTrigger ControlID="btnShowCalendarPicker" EventName="Click" />
<atlas:ControlEventTrigger ControlID="btnHideCalendarPicker" EventName="Click" />
</Triggers>
<ContentTemplate>
<!-- calendar picker -->
<asp:Calendar ID="cldCalendar" runat="server" Visible="false" OnSelectionChanged="cldCalendar_SelectionChanged" ></asp:Calendar>
<!-- hides the calendar -->
<asp:imagebutton runat="server" id="btnHideCalendarPicker" onclick="HideCalendarPicker_Click" Visible="false" imageurl="~/images/smoking.jpg" height="20px" width="20px" />
</ContentTemplate>
</atlas:UpdatePanel>
</div>
</form>
</body>
</html>