i have in my aspx page
<%
for(int i=0;i<10;i++)
{
LinkButton1.CommandArgument=i.ToString();
%>
<asp:LinkButton ID="LinkButton1" runat="server" OnCommand="LinkButton1_Click"></asp:LinkButton>
<%
}
%>
how can i pass a value in my aspx.cs page like:
protected void LinkButtonStergeArticol_Click(object sender,CommandEventArgs e)
{
String id = e.CommandArgument.ToString();
}
?
i know it’s not correct because i have more LinkButtons with the same ID, but is there any solution for my problem in this scenario? Or can you suggest me another approach?
i need to have a linkbutton for every item i have in an array. then i need to pass the item’s index so that i can delete it in my aspx.cs page.
Can’t you use a Repeater or ListView to generate that list of controls? Those are designed to generate a list of controls.