|
How to specify the text of the Label control from the code-behind?
by: Itfunda
Product Type: Tips and Tricks (Books)
Technologies: ASP.NET
This how to describes you how to specify the text of the Label control from the code-behind.
ASPX PAGE <p><asp:Label ID="Label2" runat="server" Text="My second Label"></asp:Label></p>
CODE BEHINDprotected void Page_Load(object sender, EventArgs e){ // writeing text from code behind Label2.Text = "Written from code behind";}
Specify the Text property from the code behind, this will write the text on the browser.
Demo Path: /Label-Literal/LabelPage.aspx
|