I am using an ASP repeater control to output a list to the visitor.
I want to have a delete link that will remove the item from the list using a function “Remove” in my codebehind.
To get this to work I need to pass the Container.ItemIndex value as an arguement, but I can’t for the life of me get it to work.
I tried this code:
<asp:LinkButton ID="Remove" runat="server" OnCommand="Remove" CommandName="Remove" CommandArgument="<%# Container.ItemIndex %>" >Delete</asp:LinkButton>
But when I try to insert Container.ItemIndex into CommandArgument it does not work.
I’m baffled and have hit a dead end. Can anyone see what I am trying to do and help me?
I believe single quotes are required with code blocks: