Click here to Skip to main content
16,012,168 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello to all..
i have a repeater and in this i have a button and a label(i.e. ID)
on click of an button inside any row i want to label text of that row...
how can i do this..
sorry i have unable to post my code at that time..

it looks like ...as..

ASP.NET
<repeater id="Rptr1">
<item template="">
<Linkbutton id="Lnkb1" Text="View Detail"  runat="server">
<Label Id="Lbl1" Text='<%#("ID")%>' 

<item template="">
</item></item></repeater>


please give reply and thanks in advance
Posted
Updated 10-Feb-13 20:24pm
v2

1 solution

Hi,

In the onclick event of the link button, try like below
C#
protected void btnCLick(object sender, EventArgs e)
{
   Label lbl = (Label)((LinkButton)sender).Parent.FindControl("Lbl1"));
   string text = lbl.Text;
   string ID = lbl.ID;
}


hope it helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900