How to make a linkbutton onclick with parameters
问题 HTML : <asp:LinkButton ID="lnk_productImage" runat="server" Text="select" OnClick="viewProductImage('<%#DataBinder.Eval(Container.DataItem,"Id") %>')" > </asp:LinkButton> CodeBehind: protected void viewProductImage(object sender, EventArgs e, int id) { //Load Product Image } 回答1: I see you're using a repeater, so you probably could use this code: In your repeater template: <asp:Repeater ID="_postsRepeater" runat="server" OnItemCommand="_postsRepeater_ItemCommand"> <ItemTemplate><asp