Click here to Skip to main content
16,016,178 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi friends ,

I am having 40 link buttons in one page ,I need the text of the button what I have clicked , can we get this requirement in one event ?

One click event how can we find which button is clicked , Please help me guys .

I have tried but I am not getting how to do please give me the solution ..

thanks
Mani ..
Posted
Comments
Sinisa Hajnal 15-May-15 3:23am    
Show the code what you've tried. This is very simple requirement that can be found easily on the net.

1 solution

<asp:LinkButton ID="Link1" runat="server" OnClick="Link1_Click" Text="Hello world" />


C#
protected void Link1_Click(object sender, EventArgs e)
{
    LinkButton lb = (LinkButton)sender;

    string text = lb.Text;
}
 
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