I have a DataList within an UpdatePanel that is dynamically bound to a collections object. The DataList uses an item template as well as a selected item template. I am having the issue that selecting an item (via a LinkButton) doesn't trigger the UpdatePanel to render the Selected item template, even when the UpdatePanel.Update() method is called from the SelectedIndexChanged event handler. I'v confident that the Load event is occurring before the SelectedIndexChanged event does, but even so wouldn't calling Update() from the event handler account for this?
<asp:UpdatePanel ID="update_Top" runat="server" UpdateMode="Conditional" onload="update_Top_Load">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
<ContentTemplate>
<asp:DataList ID="queryList" runat="server"
onselectedindexchanged="queryList_SelectedIndexChanged">
<ItemTemplate>
<asp:Panel ID="QueryPanel" runat="server" Height="55" Width="870" BackImageUrl="~/Images/smallRedButton.png" Direction="LeftToRight" Wrap="False" CssClass="queryButton">
<asp:LinkButton ID="subjInfo" runat="server" CssClass="linkButton" CommandName="select" Text='<%# String.Format("{0,-3} {1,-20}{2}",Eval("Value.subjectInitials"),Eval("Value.subjectNumber"),Eval("Value.timestamp")).Replace(" "," ") %>' />
</asp:Panel>
</ItemTemplate>
<SeparatorTemplate>
<br />
</SeparatorTemplate>
<SelectedItemTemplate>
<asp:Panel ID="QueryPanel_selected" runat="server" Height="115" Width="870" BackImageUrl="~/Images/largeRedButton.png" Direction="LeftToRight" Wrap="False" CssClass="queryButton">
<asp:LinkButton ID="subjInfo_selected" runat="server" CssClass="linkButton" Text='<%# String.Format("{0} {1,-20}{2}",Eval("Value.subjectInitials"),Eval("Value.subjectNumber"),Eval("Value.timestamp")).Replace(" "," ") %>' CommandName="cancel" />
<br />
<asp:Label runat="server" ID="queryText" CssClass="queryButton_maximized" Text='<%# StripHTMLTags(Eval("Value.queryText")) %>'></asp:Label>
</asp:Panel>
</SelectedItemTemplate>
</asp:DataList>
</ContentTemplate>
Basically a selected item should appear twice as large and with more data than the rest of the items. Clicking on the LinkButton does nothing until the UpdatePanel refresh is triggered by Timer1.
This is my first attempt at an ASP.NET app, so any insight or advice would be greatly appreciated.