Click here to Skip to main content
11,411,494 members (65,899 online)
Rate this: bad
Please Sign up or sign in to vote.
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

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

please give reply and thanks in advance
Posted 10-Feb-13 21:18pm
Edited 10-Feb-13 21:24pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


In the onclick event of the link button, try like below
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.

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

  Print Answers RSS
0 OriginalGriff 213
1 Sergey Alexandrovich Kryukov 195
2 Sascha Lefévre 120
3 ProgramFOX 90
4 Dave Kreskowiak 90
0 Sergey Alexandrovich Kryukov 8,920
1 OriginalGriff 7,128
2 Maciej Los 3,440
3 Abhinav S 3,248
4 Peter Leow 3,059

Advertise | Privacy | Mobile
Web03 | 2.8.150414.5 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100