aspx.cs:
<asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> Item </ItemTemplate> <FooterTemplate> Footer <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </FooterTemplate> </asp:Repeater> <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
Right way to do that was this way:
RepeaterItem riFooter=Repeater1.Controls[Repeater1.Controls.Count-1] as RepeaterItem; if (riFooter != null && riFooter.ItemType == ListItemType.Footer) { TextBox TextBox1 = riFooter.FindControl("TextBox1") as TextBox; if (TextBox1 != null) { TextBox1.Text = "Test"; } }
No comments:
Post a Comment