Asp.net Label Server Control


Label Control

The Label control is used to display text on a page. The text is programmable.

Source Code

First Example:
    <asp:Label ID="Label1" runat="server">asp:Label>
Second Example:
    <asp:Label ID="Label2" runat="server" Text="This is Label 2">
    asp:Label>
Third Example:
    <asp:Label ID="Label3" runat="server">asp:Label>

Code File
protected void Page_Load(object sender, EventArgs e)
    {
        Label1.Text ="Current Date & Time :"+" "+ DateTime.Now.ToString();
        Label3.Text = "This is 3rd Label";
    }

0 comments:

Post a Comment