I tried your fix and yes, it works for target controls inside
templates, but the error still appears when you have the target control
inside an UpdatePanel.
I hope the problem will be fixed in the next release of the toolkit, but, until then, it is possible to simulate the PopupControl using the CollapsiblePanel and a div with its style set to z-index: 1, position: absolute
<cc22:collapsiblepanelextender id="collapsibleActionDateEI" runat="server">
<cc22:CollapsiblePanelProperties CollapseControlID="tbActionDateEI" Collapsed="True"
AutoCollapse="True" AutoExpand="True" CollapsedSize="0" ExpandControlID="tbActionDateEI"
ExpandedSize="180" TargetControlID="calendarActionDateEI" />
</cc22:collapsiblepanelextender>
<asp:TextBox ID="tbActionDateEI" runat="server" Width="200px"></asp:TextBox>
<div id="divCalendar" runat="server" style="display: block; z-index: 1; position: absolute; ">
<asp:Calendar ID="calendarActionDateEI" runat="server" BackColor="White" BorderColor="#999999"
CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black"
Height="180px" OnSelectionChanged="calendarActionDateEI_SelectionChanged" Width="200px">
<SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#FFFFCC" />
<OtherMonthDayStyle ForeColor="#808080" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
</asp:Calendar>
</div> It works fine when it is placed inside an update panel - i have it as an user control for reusability.
Oh, you need to add the event handler for the calendar:
protected void calendarActionDateEI_SelectionChanged(object sender, EventArgs e)
{
tbActionDateEI.Text = calendarActionDateEI.SelectedDate.ToShortDateString();
} I hope this helps.
Vlad