asp.net example - multiline label
multiline-label.aspx
<%@ Page Language="C#" AutoEventWireup="true"%>
<!DOCTYPE html>
<script runat="server">
protected void Button1_Click(object sender, System.EventArgs e)
{
Label1.Text = "this is line one.";
Label1.Text += "<br />this is line number two.";
Label1.Text += "<br>this is line number three.";
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>asp.net example - multiline label</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:MidnightBlue; font-style:italic;">
asp.net example - multiline label
</h2>
<hr width="550" align="left" color="Gainsboro" />
<asp:Label
ID="Label1"
runat="server"
Font-Size="X-Large"
Text="this is a sample label to test multi line label."
>
</asp:Label>
<br /><br /><br />
<asp:Button
ID="Button1"
runat="server"
Text="multiline label"
OnClick="Button1_Click"
Height="40"
Font-Bold="true"
/>
</div>
</form>
</body>
</html>

- How to add an onClick event to a Label
- How to align Label text to right
- How to apply CSS style to a Label
- How to encode html in a Label
- How to trim text with ellipsis in a Label
- How to display an image in a Label
- How to justify the text in a Label
- How to display a link in a Label
- How to add top margin to a Label
- How add padding to a Label