i got a problem with adding a LinkButton array with one event for all
to a webpage. I read some posts about that here but some are not
answered and some have no solution for me.
I added a LinkButton Array at the top of the page as member variable:
private LinkButton LinkButtonEdit;
So that the events will be registered on every page load i created
a method private void InitializeLinkButtonEditEvents() wich is called
standard Page_Load Method.
It contains the following code:
dbimages --> Create dbimages DataTable from some database rows.
LinkButtonEdit = new LinkButton[dbimages.Rows.Count]; int rowcount =
foreach (DataRow row in dbimages.Rows )
LinkButtonEdit[rowcount] = new LinkButton();
LinkButtonEdit[rowcount].Text = "Edit";
LinkButtonEdit[rowcount].ID = "LinkButtonEdit_" +
LinkButtonEdit[rowcount].Click += new
I add a table with the entries of the above datatable to the page
wich is showing some of the data and add the link button to each line
cellopt.Controls.Add( LinkButtonEdit[rowcount] );
I added some Event Method
private void LinkButtonEdit_Click(object sender, System.EventArgs e)
with some debug output to a Label
The problem is: the event is not be fired - the page reloads but
i can't see my message. The link commands in the page-source looks
What went wrong? Any suggestions? I have a working page like that
where the only difference is that i only got a char for the
Thanks for some comment about that and best regards.