asp.net example - label databind
label-databind.aspx
<%@ Page Language="C#" AutoEventWireup="true"%>
<!DOCTYPE html>
<script runat="server">
protected void TextBox1_TextChanged(object sender, System.EventArgs e)
{
Page.DataBind();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>asp.net example - label databind</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:MidnightBlue; font-style:italic;">
asp.net example - label databind
</h2>
<hr width="550" align="left" color="Gainsboro" />
<asp:Label
ID="Label1"
runat="server"
Text='<%# TextBox1.Text %>'
Font-Size="XX-Large"
ForeColor="HotPink"
>
</asp:Label>
<br /><br /><br />
<asp:TextBox
ID="TextBox1"
runat="server"
OnTextChanged="TextBox1_TextChanged"
AutoPostBack="true"
Width="250"
>
</asp:TextBox>
</div>
</form>
</body>
</html>
- How to add an onClick event to a Label
- How to create a multiline Label
- How to change Label width using CSS
- How to align text to center in a Label
- How to display html tags in a Label
- How to display none in a Label
- How to encode html in a Label
- How to add an item to DropDownList after databind
- How to change DropDownList selected item color
- How to display different tooltip on ListBox items