yko
-
11/7/2008 12:48:26 PM
Link buttons don't fire ItemCommand in repeater control
Hello,
I have a repeater in user control: <asp:Repeater id="rpt1" runat="server" OnItemDataBound="rpt1_ItemDataBound" OnItemCommand="rpt1_ItemCommand"> <ItemTemplate> ... <asp:linkbutton id="lnkAdd" CausesValidation="false" runat="server">Add</asp:linkbutton> ... </ItemTemplate> </asp:Repeater>
CommandName and CommandArgument properties of the link button are set in ItemDataBound event: LinkButton lnkAdd = (LinkButton)e.Item.FindControl("lnkAdd"); lnkAdd.CommandName = "Add"; lnkAdd.CommandArgument = id.ToString();
Repeater's DataBind method is called in Page_PreRender: protected void Page_PreRender(object sender, EventArgs e) { ... rpt1.DataSource = arr; rpt1.DataBind(); ... }
But ItemCommand (rpt1_ItemCommand) event doesn't fire. Any ideas why?
Thanks
|