The Literal control property :
S.N. |
Property | Description |
1) | ID | Set the uniqe value to control to access in code-behind code. |
2) | Text | The error message displayed when validation fails. |
3) | Mode | When click on label focus is automatically set in associte textfield control. |
The Mode property enables we to encode HTML content and accepts any of
the following three values:
PassThrough
—Displays the contents of the control without encoding.
Encode
—Displays the contents of the control after HTML encoding the content.
Transform
—Displays the contents of the control after stripping markup not supported by the requesting device.
<<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
PageTitle.Text = DateTime.Now.ToString("M");
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>
<asp:Literal ID="PageTitle" runat="Server" /></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Literal ID="Literal1" runat="server" Text="Welcome to Asp.net" ></asp:Literal>
<h1>
Look in the title bar</h1>
</div>
</form>
</body>
</html>