Click here to Skip to main content
13,000,469 members (58,362 online)
Rate this:
Please Sign up or sign in to vote.
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

<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 20:18pm
Updated 10-Feb-13 20: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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170624.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2017
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