Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I display a variables value in a label in asp.net using C#?
Posted

just like that...

suppose your lable id is like lbltest and your varialbe is type of integer and its alias is abc so you can display its value like this...


C#
int abc = 10;
lbltest.Text = abc.ToString();
 
Share this answer
 
You can display variable at Client side and Server side as well

At Client side using javascript like that..

JavaScript
var i = 123;

 document.getElementById(lblID).innerHTML = i;


At Server side in code behind like that...

C#
string ValueString = "My Name Is Nirav";

 lblID.Text = ValueString;
 
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