Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hai


I want to get the javascript variable value to asp label value


thanks..............
Posted

You will have to get the ClientID of your label. Then you can use plain javascript to set it's innerHTML property to what you want
JavaScript
document.getElementById('<%=lbl.ClientID%>').innerHTML = 'MyValue';
 
Share this answer
 
v2
Comments
ujju.1 16-Aug-12 2:56am    
my +5 :)
StianSandberg 16-Aug-12 3:09am    
thank you :)
hii ,
use
document.getElementById('<%=lbl.ClientID%>').value= 'MyValue';
 
Share this answer
 
Textbox value print on label.
var txt1=getElementById('<%=TextBox.ClientID%>').value
Find 2 Way use
document.getElementById('<%=Label.ClientID%>').innerHTML = txt1;
document.getElementById('<%=Label.ClientID%>').value= txt1;
 
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