this might be very easy. i have a linkbutton inside a gridview. so basically every row will have this link button. what i am trying to do is to click this button and it should display the button text in a label. very simple. but right now if i click the button in any row of the gridview, it only display the last row button text.
i know i am making a mistake but dont know where. what i want is to display the text of the button for whatever row i clicked. this is what i mean
LinkButton1 --------- inside a Gridview
so if i click on A12, it should display A12 in the label and similarly for A13, A14,A15 but right now it only display A15 no matter where i click
here is the code for the linkbutton
protected void LinkButton1_Click(object sender, EventArgs e)
foreach (GridViewRow row in GridView1.Rows)
LinkButton lbBtn = (LinkButton)row.FindControl("LinkButton1");
lbtest.Text = lbBtn.Text;
any help is appreciated.