Click here to Skip to main content
15,878,871 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to transfer one label value to another label using asp.net C#

Below is my label code:

<asp:Label ID="Label1" runat="server" Text='<%#Bind("VideoName") %>' >

Want to transfer this bind value to below label:

<asp:Label ID="Label2" runat="server" Text="Label">

i need label1 bind value to label2 text. ex: Text="Movie"
Posted
Comments
Kornfeld Eliyahu Peter 1-Jul-14 8:19am    
Label1.Text = Label2.Text
mazharkhan123 1-Jul-14 8:29am    
there are no.of of video name is there. fetching video name from database table. as u seen above bind("videoName") that value to transfer.

1 solution

First change
<asp:Label ID="Label2" runat="server" Text="Label">
to
<asp:Label ID="Label2" runat="server" Text="">


next in code behind assign Label2.text= Label1.text;
 
Share this answer
 
Comments
Member 14073583 18-Feb-19 6:53am    
Yeah its okay. but i don't want to write in c# and it should not be runat(means not dynamic).
please find a solution for this

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