by Emmaneale Mendu, Web Developer
The Label Server control is used to display text in the browser. Because this is a server control, you can dynamically alter the text from your server-side code.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Label Control Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>
<asp:Label ID="lblUserName" runat="server" Text="UserName"></asp:Label>
<asp:TextBox ID="txtUserName" runat="server"></asp:TextBox></p>
<p>
<asp:Label ID="lblPassWord" runat="server" Text="PassWord"></asp:Label>
<asp:TextBox ID="txtPassWord" runat="server"></asp:TextBox>
</p>
<p style="padding-left: 80px">
<asp:Button ID="btnSubmit" runat="server" Text="Submit" /></p>
</div>
</form>
</body>
</html>
Programmatically providing text to the Label control
Label1.Text = "Hello Emmaneale";
0 comments:
Post a Comment