我在中继器中有一个UpdatePanel。
UpdatePanel中有几个AutoPostBack=“true”的复选框
UpdatePanel中有一个标签。我在RepeaterName_ItemDataBound中设置标签的Text值,因为它在生成的每个项目上运行。
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="XmlDataSource" OnItemDataBound="R1_ItemDataBound">
<ItemTemplate>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div>
<asp:Label ID="DateTimeLabel2" runat="server" Text="Label"></asp:Label>
<asp:Panel ID="panID" CssClass="actionicon_normal actionicon_compare" runat="server">
<%#XPath("ID")%>
<asp:CheckBox ID="chkID" runat="server" AutoPostBack="true" />
</asp:Panel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:Repeater>
I want the CheckBoxes to automatically update the UpdatePanel as there were no repeater around, but possibly because the OnItemDataBound does not fire on every AsyncPostBack, nothing gets updated. What is the proper way to do this?