I have some texts in my database. Each text has its own id.
My job is to print all texts to a website and add a button to each text. Button will delete appropriate text from the database.
So, I created a for loop so I can print all texts from the db, I also put <asp:Button id="button" runat="server" Text="delete" onclick="some_method" </asp> in the loop.
My problem is that all buttons have the same id and the program cannot know what text to delete. I tried to put in the id attribute a variable created before but I got the message that I cannot put <% %> inside button tag.
I also tried this:
buttonX.Attributes.Add("id", "123");
But onclick event didn't get this id.
Any suggestions. Thank you.